Use roberta model and update doc strings

This commit is contained in:
Matt Maybeno
2019-10-23 21:31:28 -07:00
committed by Julien Chaumond
parent 66085a1321
commit b92d68421d
2 changed files with 6 additions and 2 deletions

View File

@@ -396,7 +396,7 @@ class TFRobertaForTokenClassification(TFRobertaPreTrainedModel):
tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
model = TFRobertaForTokenClassification.from_pretrained('roberta-base')
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute"))[None, :] # Batch size 1
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True))[None, :] # Batch size 1
outputs = model(input_ids)
scores = outputs[0]