KoichiYasuoka
commited on
Commit
•
3dd7ca3
1
Parent(s):
dcea747
usage improved
Browse files
README.md
CHANGED
@@ -27,7 +27,7 @@ tokenizer=AutoTokenizer.from_pretrained("KoichiYasuoka/roberta-base-thai-syllabl
|
|
27 |
model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/roberta-base-thai-syllable-upos")
|
28 |
s="หลายหัวดีกว่าหัวเดียว"
|
29 |
t=tokenizer.tokenize(s)
|
30 |
-
p=[model.config.id2label[q] for q in torch.argmax(model(tokenizer.encode(s,return_tensors="pt"))[
|
31 |
print(list(zip(t,p)))
|
32 |
```
|
33 |
|
|
|
27 |
model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/roberta-base-thai-syllable-upos")
|
28 |
s="หลายหัวดีกว่าหัวเดียว"
|
29 |
t=tokenizer.tokenize(s)
|
30 |
+
p=[model.config.id2label[q] for q in torch.argmax(model(tokenizer.encode(s,return_tensors="pt"))["logits"],dim=2)[0].tolist()[1:-1]]
|
31 |
print(list(zip(t,p)))
|
32 |
```
|
33 |
|