Esempio n. 1
0
 def build_model(self, transformer, max_length, **kwargs):
     model, self.transform.tokenizer = build_transformer(
         transformer,
         max_length,
         len(self.transform.label_vocab),
         tagging=False)
     return model
Esempio n. 2
0
 def build_model(self, transformer, max_seq_length,
                 **kwargs) -> tf.keras.Model:
     model, tokenizer = build_transformer(transformer,
                                          max_seq_length,
                                          len(self.transform.tag_vocab),
                                          tagging=True)
     self.transform.tokenizer = tokenizer
     return model
Esempio n. 3
0
 def load_transform(self, save_dir) -> Transform:
     super().load_transform(save_dir)
     self.transform.tokenizer = build_transformer(
         self.config.transformer,
         self.config.max_seq_length,
         len(self.transform.tag_vocab),
         tagging=True,
         tokenizer_only=True)
     return self.transform