Views
No views yet
camembert-mwer is a model that was fine-tuned from CamemBERT as a token classification task specifically on the Sequoia dataset for the MWER task.1>>> from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
2>>> tokenizer = AutoTokenizer.from_pretrained("bvantuan/camembert-mwer")
3>>> model = AutoModelForTokenClassification.from_pretrained("bvantuan/camembert-mwer")
4>>> mwe_classifier = pipeline('token-classification', model=model, tokenizer=tokenizer)
5>>> sentence = "Pour ce premier rendez-vous, l'animateur a pu faire partager sa passion et présenter quelques oeuvres pour mettre en bouche les participants."
6>>> mwes = mwe_classifier(sentence)
7
8[{'entity': 'B-MWE',
9 'score': 0.99492574,
10 'index': 4,
11 'word': '▁rendez',
12 'start': 15,
13 'end': 22},
14 {'entity': 'I-MWE',
15 'score': 0.9344883,
16 'index': 5,
17 'word': '-',
18 'start': 22,
19 'end': 23},
20 {'entity': 'I-MWE',
21 'score': 0.99398583,
22 'index': 6,
23 'word': 'vous',
24 'start': 23,
25 'end': 27},
26 {'entity': 'B-VID',
27 'score': 0.9827843,
28 'index': 22,
29 'word': '▁mettre',
30 'start': 106,
31 'end': 113},
32 {'entity': 'I-VID',
33 'score': 0.9835186,
34 'index': 23,
35 'word': '▁en',
36 'start': 113,
37 'end': 116},
38 {'entity': 'I-VID',
39 'score': 0.98324823,
40 'index': 24,
41 'word': '▁bouche',
42 'start': 116,
43 'end': 123}]
44
45>>> mwe_classifier.group_entities(mwes)
46
47[{'entity_group': 'MWE',
48 'score': 0.9744666,
49 'word': 'rendez-vous',
50 'start': 15,
51 'end': 27},
52 {'entity_group': 'VID',
53 'score': 0.9831837,
54 'word': 'mettre en bouche',
55 'start': 106,
56 'end': 123}]| Sequoia | train | dev | test | |
|---|---|---|---|---|
| #sentences | 3099 | 1955 | 273 | 871 |
| #MWEs | 3450 | 2170 | 306 | 974 |
| #Unseen MWEs | _ | _ | 100 | 300 |
| Global MWE-based | Unseen MWE-based | ||||
| Precision | Recall | F1 | Precision | Recall | F1 |
| 83.78 | 83.78 | 83.78 | 57.05 | 60.67 | 58.80 |
1@article{martin2019camembert,
2 title={CamemBERT: a tasty French language model},
3 author={Martin, Louis and Muller, Benjamin and Su{\'a}rez, Pedro Javier Ortiz and Dupont, Yoann and Romary, Laurent and de La Clergerie, {\'E}ric Villemonte and Seddah, Djam{\'e} and Sagot, Beno{\^\i}t},
4 journal={arXiv preprint arXiv:1911.03894},
5 year={2019}
6}
7
8@article{candito2020french,
9 title={A French corpus annotated for multiword expressions and named entities},
10 author={Candito, Marie and Constant, Mathieu and Ramisch, Carlos and Savary, Agata and Guillaume, Bruno and Parmentier, Yannick and Cordeiro, Silvio Ricardo},
11 journal={Journal of Language Modelling},
12 volume={8},
13 number={2},
14 year={2020},
15 publisher={Polska Akademia Nauk. Instytut Podstaw Informatyki PAN}
16}
17