예제 #1
0
파일: tasks.py 프로젝트: LinHR000/pytext
 class Config(Task.Config):
     data_handler: Union[LanguageModelDataHandler.Config,
                         BPTTLanguageModelDataHandler.
                         Config] = LanguageModelDataHandler.Config()
     model: LMLSTM.Config = LMLSTM.Config()
     trainer: Trainer.Config = Trainer.Config()
     labels: Optional[WordLabelConfig] = None
     metric_reporter: LanguageModelMetricReporter.Config = (
         LanguageModelMetricReporter.Config())
예제 #2
0
 class Config(Task_Deprecated.Config):
     # Have PlaceHolder to keep it as Union so we don't have to write config adapter
     # for it, this class should be removed soon
     data_handler: Union[LanguageModelDataHandler.Config,
                         PlaceHolder] = LanguageModelDataHandler.Config()
     model: LMLSTM_Deprecated.Config = LMLSTM_Deprecated.Config()
     trainer: Trainer.Config = Trainer.Config()
     labels: Optional[WordLabelConfig] = None
     metric_reporter: LanguageModelMetricReporter.Config = (
         LanguageModelMetricReporter.Config())
예제 #3
0
 def _init_data_handler(self):
     data_handler = LanguageModelDataHandler.from_config(
         LanguageModelDataHandler.Config(),
         FeatureConfig(),
         WordLabelConfig(),
         featurizer=create_featurizer(SimpleFeaturizer.Config(), FeatureConfig()),
         shuffle=False,
     )
     data_handler.init_metadata_from_path(FILE_NAME, FILE_NAME, FILE_NAME)
     return data_handler