Пример #1
0
 def create_metric_reporter(cls, config: Config,
                            tensorizers: Dict[str, Tensorizer]):
     return NERMetricReporter(
         channels=[ConsoleChannel()],
         label_names=list(tensorizers["tokens"].labels_vocab._vocab),
         pad_idx=tensorizers["tokens"].labels_pad_idx,
     )
Пример #2
0
 def from_config(cls, config: Config, tensorizers: Dict[str, Tensorizer]):
     return cls(
         [
             ConsoleChannel(),
             Seq2SeqFileChannel([Stage.TEST], config.output_path, tensorizers),
         ],
         tensorizers,
     )
 def from_config(cls, config, *args, tensorizers=None, **kwargs):
     return cls(
         channels=[
             ConsoleChannel(),
             MultiSpanQAFileChannel((Stage.TEST, ), config.output_path),
         ],
         tensorizer=tensorizers["tokens"],
     )
 def from_config(cls, config, *args, tensorizers=None, **kwargs):
     return cls(
         channels=[
             ConsoleChannel(),
             FileChannel((Stage.TEST, ), config.output_path)
         ],
         text_column_names=config.text_column_names,
         model_select_metric=config.model_select_metric,
         task_batch_size=config.task_batch_size,
         num_negative_ctxs=config.num_negative_ctxs,
     )
Пример #5
0
 def from_config(cls, config, *args, tensorizers=None, **kwargs):
     return cls(
         channels=[
             ConsoleChannel(),
             SquadFileChannel((Stage.TEST, ), config.output_path),
         ],
         n_best_size=config.n_best_size,
         max_answer_length=config.max_answer_length,
         ignore_impossible=config.ignore_impossible,
         has_answer_labels=tensorizers["has_answer"].vocab._vocab,
         tensorizer=tensorizers["squad_input"],
         false_label=config.false_label,
     )
Пример #6
0
 def from_config(cls, config: Config, tensorizers: Dict[str, Tensorizer]):
     channels = [ConsoleChannel()]
     if config.TEMP_DUMP_PREDICTIONS:
         channels.append(
             Seq2SeqFileChannel([Stage.TEST], config.output_path, tensorizers),
         )
     return cls(
         channels,
         config.log_gradient,
         tensorizers,
         config.model_select_metric_key,
         config.select_length_beam,
         config.print_length_metrics,
     )
Пример #7
0
 def from_config(cls, config: Config, tensorizers: Dict[str, Tensorizer]):
     return cls(
         [
             ConsoleChannel(),
             CompositionalSeq2SeqFileChannel(
                 [Stage.TEST],
                 config.output_path,
                 tensorizers,
                 config.accept_flat_intents_slots,
             ),
         ],
         tensorizers,
         config.accept_flat_intents_slots,
     )
Пример #8
0
 def from_config(cls, config: Config, tensorizers: Dict[str, Tensorizer]):
     channels = [ConsoleChannel()]
     if config.TEMP_DUMP_PREDICTIONS:
         channels.append(
             MaskedCompositionalSeq2SeqFileChannel(
                 [Stage.TEST],
                 config.output_path,
                 tensorizers,
                 config.accept_flat_intents_slots,
             ))
     return cls(
         channels,
         config.log_gradient,
         tensorizers,
         config.accept_flat_intents_slots,
         config.model_select_metric_key,
         config.select_length_beam,
     )
Пример #9
0
 def from_config(cls, config, tensorizers):
     return MyTaggingMetricReporter(
         channels=[ConsoleChannel(), TensorBoardChannel()],
         label_names=tensorizers["slots"].vocab,
     )
Пример #10
0
 def from_config0(cls, config, vocab):
     return MyTaggingMetricReporter(
         channels=[ConsoleChannel(), TensorBoardChannel()],
         label_names=vocab)
Пример #11
0
 def create_metric_reporter(cls, config, tensorizers):
     return MyTaggingMetricReporter(
         channels=[ConsoleChannel(), TensorBoardChannel()],
         label_names=list(tensorizers["slots"].vocab),
     )
Пример #12
0
 def from_config(cls, config, *args, **kwargs):
     return cls([ConsoleChannel()], config.pep_format)
 def from_config(cls, config: PyTextConfig, pad_index: int = -1):
     return cls(channels=[ConsoleChannel()], pad_index=pad_index)