Update README.md
Browse files
README.md
CHANGED
|
@@ -42,4 +42,9 @@ tokenizer = AutoTokenizer.from_pretrained("Emanuel/autonlp-pos-tag-bosque")
|
|
| 42 |
inputs = tokenizer("A noiva casa de branco", return_tensors="pt")
|
| 43 |
|
| 44 |
outputs = model(**inputs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
```
|
|
|
|
| 42 |
inputs = tokenizer("A noiva casa de branco", return_tensors="pt")
|
| 43 |
|
| 44 |
outputs = model(**inputs)
|
| 45 |
+
|
| 46 |
+
labelids = outputs.logits.squeeze().argmax(axis=-1)
|
| 47 |
+
labels = [model.config.id2label[int(x)] for x in labelids]
|
| 48 |
+
labels = labels[1:-1]# Filter start and end of sentence symbols
|
| 49 |
+
|
| 50 |
```
|