def test_column_mapping(self): task = Summarization(text_column="input_text", summary_column="input_summary") self.assertDictEqual({ "input_text": "text", "input_summary": "summary" }, task.column_mapping)
def test_from_dict(self): input_schema = Features({"text": Value("string")}) label_schema = Features({"summary": Value("string")}) template_dict = {"text_column": "input_text", "summary_column": "input_summary"} task = Summarization.from_dict(template_dict) self.assertEqual("summarization", task.task) self.assertEqual(input_schema, task.input_schema) self.assertEqual(label_schema, task.label_schema)