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
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
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