KoichiYasuoka commited on
Commit
3dd7ca3
1 Parent(s): dcea747

usage improved

Browse files
Files changed (1) hide show
  1. README.md +1 -1
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"))[0],dim=2)[0].tolist()[1:-1]]
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