pip install transformers1from transformers import CamembertTokenizer, CamembertForTokenClassification, TokenClassificationPipeline
2
3tokenizer = CamembertTokenizer.from_pretrained('taln-ls2n/POET')
4model = CamembertForTokenClassification.from_pretrained('taln-ls2n/POET')
5pos = TokenClassificationPipeline(model=model, tokenizer=tokenizer)
6
7def make_prediction(sentence):
8 labels = [l['entity'] for l in pos(sentence)]
9 return list(zip(sentence.split(" "), labels))
10
11res = make_prediction("George Washington est allé à Washington")ANTILLES is a part-of-speech tagging corpora based on UD_French-GSD which was originally created in 2015 and is based on the universal dependency treebank v2.0.PRON VERB SCONJ ADP CCONJ DET NOUN ADJ AUX ADV PUNCT PROPN NUM SYM PART X INTJ| Abbreviation | Description | Examples |
|---|---|---|
| PREP | Preposition | de |
| AUX | Auxiliary Verb | est |
| ADV | Adverb | toujours |
| COSUB | Subordinating conjunction | que |
| COCO | Coordinating Conjunction | et |
| PART | Demonstrative particle | -t |
| PRON | Pronoun | qui ce quoi |
| PDEMMS | Demonstrative Pronoun - Singular Masculine | ce |
| PDEMMP | Demonstrative Pronoun - Plural Masculine | ceux |
| PDEMFS | Demonstrative Pronoun - Singular Feminine | cette |
| PDEMFP | Demonstrative Pronoun - Plural Feminine | celles |
| PINDMS | Indefinite Pronoun - Singular Masculine | tout |
| PINDMP | Indefinite Pronoun - Plural Masculine | autres |
| PINDFS | Indefinite Pronoun - Singular Feminine | chacune |
| PINDFP | Indefinite Pronoun - Plural Feminine | certaines |
| PROPN | Proper noun | Houston |
| XFAMIL | Last name | Levy |
| NUM | Numerical Adjective | trentaine vingtaine |
| DINTMS | Masculine Numerical Adjective | un |
| DINTFS | Feminine Numerical Adjective | une |
| PPOBJMS | Pronoun complements of objects - Singular Masculine | le lui |
| PPOBJMP | Pronoun complements of objects - Plural Masculine | eux y |
| PPOBJFS | Pronoun complements of objects - Singular Feminine | moi la |
| PPOBJFP | Pronoun complements of objects - Plural Feminine | en y |
| PPER1S | Personal Pronoun First-Person - Singular | je |
| PPER2S | Personal Pronoun Second-Person - Singular | tu |
| PPER3MS | Personal Pronoun Third-Person - Singular Masculine | il |
| PPER3MP | Personal Pronoun Third-Person - Plural Masculine | ils |
| PPER3FS | Personal Pronoun Third-Person - Singular Feminine | elle |
| PPER3FP | Personal Pronoun Third-Person - Plural Feminine | elles |
| PREFS | Reflexive Pronoun First-Person - Singular | me m' |
| PREF | Reflexive Pronoun Third-Person - Singular | se s' |
| PREFP | Reflexive Pronoun First / Second-Person - Plural | nous vous |
| VERB | Verb | obtient |
| VPPMS | Past Participle - Singular Masculine | formulé |
| VPPMP | Past Participle - Plural Masculine | classés |
| VPPFS | Past Participle - Singular Feminine | appelée |
| VPPFP | Past Participle - Plural Feminine | sanctionnées |
| DET | Determinant | les l' |
| DETMS | Determinant - Singular Masculine | les |
| DETFS | Determinant - Singular Feminine | la |
| ADJ | Adjective | capable sérieux |
| ADJMS | Adjective - Singular Masculine | grand important |
| ADJMP | Adjective - Plural Masculine | grands petits |
| ADJFS | Adjective - Singular Feminine | française petite |
| ADJFP | Adjective - Plural Feminine | légères petites |
| NOUN | Noun | temps |
| NMS | Noun - Singular Masculine | drapeau |
| NMP | Noun - Plural Masculine | journalistes |
| NFS | Noun - Singular Feminine | tête |
| NFP | Noun - Plural Feminine | ondes |
| PREL | Relative Pronoun | qui dont |
| PRELMS | Relative Pronoun - Singular Masculine | lequel |
| PRELMP | Relative Pronoun - Plural Masculine | lesquels |
| PRELFS | Relative Pronoun - Singular Feminine | laquelle |
| PRELFP | Relative Pronoun - Plural Feminine | lesquelles |
| INTJ | Interjection | merci bref |
| CHIF | Numbers | 1979 10 |
| SYM | Symbol | € % |
| YPFOR | Endpoint | . |
| PUNCT | Ponctuation | : , |
| MOTINC | Unknown words | Technology Lady |
| X | Typos & others | sfeir 3D statu |
1 precision recall f1-score support
2
3 ADJ 0.9040 0.8828 0.8933 128
4 ADJFP 0.9811 0.9585 0.9697 434
5 ADJFS 0.9606 0.9826 0.9715 918
6 ADJMP 0.9613 0.9357 0.9483 451
7 ADJMS 0.9561 0.9611 0.9586 952
8 ADV 0.9870 0.9948 0.9908 1524
9 AUX 0.9956 0.9964 0.9960 1124
10 CHIF 0.9798 0.9774 0.9786 1239
11 COCO 1.0000 0.9989 0.9994 884
12 COSUB 0.9939 0.9939 0.9939 328
13 DET 0.9972 0.9972 0.9972 2897
14 DETFS 0.9990 1.0000 0.9995 1007
15 DETMS 1.0000 0.9993 0.9996 1426
16 DINTFS 0.9967 0.9902 0.9934 306
17 DINTMS 0.9923 0.9948 0.9935 387
18 INTJ 0.8000 0.8000 0.8000 5
19 MOTINC 0.5049 0.5827 0.5410 266
20 NFP 0.9807 0.9675 0.9740 892
21 NFS 0.9778 0.9699 0.9738 2588
22 NMP 0.9687 0.9495 0.9590 1367
23 NMS 0.9759 0.9560 0.9659 3181
24 NOUN 0.6164 0.8673 0.7206 113
25 NUM 0.6250 0.8333 0.7143 6
26 PART 1.0000 0.9375 0.9677 16
27 PDEMFP 1.0000 1.0000 1.0000 3
28 PDEMFS 1.0000 1.0000 1.0000 89
29 PDEMMP 1.0000 1.0000 1.0000 20
30 PDEMMS 1.0000 1.0000 1.0000 222
31 PINDFP 1.0000 1.0000 1.0000 3
32 PINDFS 0.8571 1.0000 0.9231 12
33 PINDMP 0.9000 1.0000 0.9474 9
34 PINDMS 0.9286 0.9701 0.9489 67
35 PINTFS 0.0000 0.0000 0.0000 2
36 PPER1S 1.0000 1.0000 1.0000 62
37 PPER2S 0.7500 1.0000 0.8571 3
38 PPER3FP 1.0000 1.0000 1.0000 9
39 PPER3FS 1.0000 1.0000 1.0000 96
40 PPER3MP 1.0000 1.0000 1.0000 31
41 PPER3MS 1.0000 1.0000 1.0000 377
42 PPOBJFP 1.0000 0.7500 0.8571 4
43 PPOBJFS 0.9167 0.8919 0.9041 37
44 PPOBJMP 0.7500 0.7500 0.7500 12
45 PPOBJMS 0.9371 0.9640 0.9504 139
46 PREF 1.0000 1.0000 1.0000 332
47 PREFP 1.0000 1.0000 1.0000 64
48 PREFS 1.0000 1.0000 1.0000 13
49 PREL 0.9964 0.9964 0.9964 277
50 PRELFP 1.0000 1.0000 1.0000 5
51 PRELFS 0.8000 1.0000 0.8889 4
52 PRELMP 1.0000 1.0000 1.0000 3
53 PRELMS 1.0000 1.0000 1.0000 11
54 PREP 0.9971 0.9977 0.9974 6161
55 PRON 0.9836 0.9836 0.9836 61
56 PROPN 0.9468 0.9503 0.9486 4310
57 PUNCT 1.0000 1.0000 1.0000 4019
58 SYM 0.9394 0.8158 0.8732 76
59 VERB 0.9956 0.9921 0.9938 2273
60 VPPFP 0.9145 0.9469 0.9304 113
61 VPPFS 0.9562 0.9597 0.9580 273
62 VPPMP 0.8827 0.9728 0.9256 147
63 VPPMS 0.9778 0.9794 0.9786 630
64 VPPRE 0.0000 0.0000 0.0000 1
65 X 0.9604 0.9935 0.9766 1073
66 XFAMIL 0.9386 0.9113 0.9248 1342
67 YPFOR 1.0000 1.0000 1.0000 2750
68
69 accuracy 0.9778 47574
70 macro avg 0.9151 0.9285 0.9202 47574
71weighted avg 0.9785 0.9778 0.9780 475741@inproceedings{labrak:hal-03696042,
2 TITLE = {{ANTILLES: An Open French Linguistically Enriched Part-of-Speech Corpus}},
3 AUTHOR = {Labrak, Yanis and Dufour, Richard},
4 URL = {https://hal.archives-ouvertes.fr/hal-03696042},
5 BOOKTITLE = {{25th International Conference on Text, Speech and Dialogue (TSD)}},
6 ADDRESS = {Brno, Czech Republic},
7 PUBLISHER = {{Springer}},
8 YEAR = {2022},
9 MONTH = Sep,
10 KEYWORDS = {Part-of-speech corpus ; POS tagging ; Open tools ; Word embeddings ; Bi-LSTM ; CRF ; Transformers},
11 PDF = {https://hal.archives-ouvertes.fr/hal-03696042/file/ANTILLES_A_freNch_linguisTIcaLLy_Enriched_part_of_Speech_corpus.pdf},
12 HAL_ID = {hal-03696042},
13 HAL_VERSION = {v1},
14}1@misc{
2 universaldependencies,
3 title={UniversalDependencies/UD_French-GSD},
4 url={https://github.com/UniversalDependencies/UD_French-GSD}, journal={GitHub},
5 author={UniversalDependencies}
6}1@techreport{LIA_TAGG,
2 author = {Frédéric Béchet},
3 title = {LIA_TAGG: a statistical POS tagger + syntactic bracketer},
4 institution = {Aix-Marseille University & CNRS},
5 year = {2001}
6}1@inproceedings{akbik2018coling,
2 title={Contextual String Embeddings for Sequence Labeling},
3 author={Akbik, Alan and Blythe, Duncan and Vollgraf, Roland},
4 booktitle = {{COLING} 2018, 27th International Conference on Computational Linguistics},
5 pages = {1638--1649},
6 year = {2018}
7}