예제 #1
0
파일: tasks.py 프로젝트: LinHR000/pytext
 class Config(Task.Config):
     model: SeqNNModel.Config = SeqNNModel.Config()
     trainer: Trainer.Config = Trainer.Config()
     labels: DocLabelConfig = DocLabelConfig()
     data_handler: SeqModelDataHandler.Config = SeqModelDataHandler.Config()
     metric_reporter: ClassificationMetricReporter.Config = (
         ClassificationMetricReporter.Config())
예제 #2
0
파일: tasks.py 프로젝트: borguz/pytext-1
 class Config(Task_Deprecated.Config):
     model: SeqNNModel_Deprecated.Config = SeqNNModel_Deprecated.Config()
     trainer: Trainer.Config = Trainer.Config()
     labels: DocLabelConfig = DocLabelConfig()
     data_handler: SeqModelDataHandler.Config = SeqModelDataHandler.Config()
     metric_reporter: ClassificationMetricReporter.Config = (
         ClassificationMetricReporter.Config())
     exporter: Optional[DenseFeatureExporter.Config] = None
예제 #3
0
    def setUp(self):
        self.train_data = [{
            DFColumn.DOC_LABEL:
            "cu:discuss_where",
            DFColumn.UTTERANCE:
            '["where do you wanna meet?", "MPK"]',
        }]

        self.eval_data = [
            {
                DFColumn.DOC_LABEL: "cu:discuss_where",
                DFColumn.UTTERANCE: '["how about SF?", "sounds good"]',
            },
            {
                DFColumn.DOC_LABEL: "cu:other",
                DFColumn.UTTERANCE: '["lol"]'
            },
        ]

        self.test_data = [
            {
                DFColumn.DOC_LABEL: "cu:discuss_where",
                DFColumn.UTTERANCE: '["MPK sounds good to me"]',
            },
            {
                DFColumn.DOC_LABEL: "cu:other",
                DFColumn.UTTERANCE: '["great", "awesome"]',
            },
        ]

        self.dh = SeqModelDataHandler.from_config(
            SeqModelDataHandler.Config(),
            FeatureConfig(),
            DocLabelConfig(),
            featurizer=SimpleFeaturizer.from_config(SimpleFeaturizer.Config(),
                                                    FeatureConfig()),
        )