def setUp(self): handler_config = DocClassificationDataHandler.Config() handler_config.columns_to_read.append(ModelInput.DENSE_FEAT) self.data_handler = DocClassificationDataHandler.from_config( DocClassificationDataHandler.Config(), ModelInputConfig(), [], featurizer=SimpleFeaturizer.from_config(SimpleFeaturizer.Config(), FeatureConfig()), )
class Config(Task.Config): model: DocModel.Config = DocModel.Config() trainer: Trainer.Config = Trainer.Config() features: DocClassification.ModelInputConfig = ( DocClassification.ModelInputConfig()) labels: DocClassification.TargetConfig = DocClassification.TargetConfig( ) data_handler: DocClassificationDataHandler.Config = ( DocClassificationDataHandler.Config()) metric_reporter: ClassificationMetricReporter.Config = ( ClassificationMetricReporter.Config())
class Config(Task_Deprecated.Config): model: DocModel_Deprecated.Config = DocModel_Deprecated.Config() trainer: Trainer.Config = Trainer.Config() features: DocClassification.ModelInputConfig = ( DocClassification.ModelInputConfig()) labels: DocClassification.TargetConfig = DocClassification.TargetConfig( ) data_handler: DocClassificationDataHandler.Config = ( DocClassificationDataHandler.Config()) metric_reporter: ClassificationMetricReporter.Config = ( ClassificationMetricReporter.Config()) exporter: Optional[DenseFeatureExporter.Config] = None
def setUp(self): file_name = tests_module.test_file( "knowledge_distillation_test_tiny.tsv") label_config_dict = {"target_prob": True} data_handler_dict = { "columns_to_read": [ "text", "target_probs", "target_logits", "target_labels", "doc_label", ] } self.data_handler = DocClassificationDataHandler.from_config( DocClassificationDataHandler.Config(**data_handler_dict), ModelInputConfig(), TargetConfig(**label_config_dict), featurizer=SimpleFeaturizer.from_config(SimpleFeaturizer.Config(), FeatureConfig()), ) self.data = list( self.data_handler.read_from_file(file_name, self.data_handler.raw_columns))