-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_pos_taggers.py
More file actions
23 lines (18 loc) · 1.01 KB
/
test_pos_taggers.py
File metadata and controls
23 lines (18 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from transformers import pipeline
from pprint import pprint
import esupar
# https://huggingface.co/PlanTL-GOB-ES/roberta-large-bne-capitel-pos
model_es = pipeline("token-classification", model="PlanTL-GOB-ES/roberta-large-bne-capitel-pos")
example_es = "Tengo un bonito perro. Mi perro corre rápido."
# https://huggingface.co/KoichiYasuoka/bert-base-russian-upos
model_ru = esupar.load("KoichiYasuoka/bert-base-russian-upos")
example_ru = "Предположим, твои друзья придут к власти, Майкл; отчасти это неплохо, они бы выросли немного, а? Но что они смогли бы сделать? Могут ли они воспитать вкус народа?"
# https://github.com/KoichiYasuoka/esupar
model_ko = esupar.load("ko")
example_ko = "예쁜 개가 있어요."
pos_results_es = model_es(example_es)
pos_results_ru = model_ru(example_ru)
pos_results_ko = model_ko(example_ko)
pprint(pos_results_es)
pprint(pos_results_ru)
pprint(pos_results_ko)