Jean-Baptiste
commited on
Commit
•
d8a6a96
1
Parent(s):
bf3fc5e
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: fr
|
3 |
+
widget:
|
4 |
+
dataset: Jean-Baptiste/wikiner-fr
|
5 |
+
- text: "Je m'appelle Jean-Baptiste et je vis à Paris"
|
6 |
+
---
|
7 |
+
|
8 |
+
# camembert-ner: model fine-tuned from camemBERT for NER task.
|
9 |
+
|
10 |
+
## Introduction
|
11 |
+
|
12 |
+
[camembert-ner] is a NER model that was fine-tuned from camemBERT on wikiner-fr dataset
|
13 |
+
|
14 |
+
|
15 |
+
## How to use camembert-ner with HuggingFace
|
16 |
+
|
17 |
+
##### Load camembert-ner and its sub-word tokenizer :
|
18 |
+
|
19 |
+
```python
|
20 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
21 |
+
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained("Jean-Baptiste/camembert-ner")
|
23 |
+
model = AutoModelForTokenClassification.from_pretrained("Jean-Baptiste/camembert-ner")
|
24 |
+
|
25 |
+
|
26 |
+
##### Process text sample (from wikipedia)
|
27 |
+
|
28 |
+
from transformers import pipeline
|
29 |
+
|
30 |
+
nlp = pipeline('ner', model=model, tokenizer=tokenizer, grouped_entities=True)
|
31 |
+
nlp("Apple est créée le 1er avril 1976 dans le garage de la maison d'enfance de Steve Jobs à Los Altos en Californie par Steve Jobs, Steve Wozniak et Ronald Wayne14, puis constituée sous forme de société le 3 janvier 1977 à l'origine sous le nom d'Apple Computer, mais pour ses 30 ans et pour refléter la diversification de ses produits, le mot « computer » est retiré le 9 janvier 2015.")
|
32 |
+
|
33 |
+
|
34 |
+
[{'entity_group': 'ORG',
|
35 |
+
'score': 0.9472818374633789,
|
36 |
+
'word': 'Apple',
|
37 |
+
'start': 0,
|
38 |
+
'end': 5},
|
39 |
+
{'entity_group': 'PER',
|
40 |
+
'score': 0.9838564991950989,
|
41 |
+
'word': 'Steve Jobs',
|
42 |
+
'start': 74,
|
43 |
+
'end': 85},
|
44 |
+
{'entity_group': 'LOC',
|
45 |
+
'score': 0.9831605950991312,
|
46 |
+
'word': 'Los Altos',
|
47 |
+
'start': 87,
|
48 |
+
'end': 97},
|
49 |
+
{'entity_group': 'LOC',
|
50 |
+
'score': 0.9834540486335754,
|
51 |
+
'word': 'Californie',
|
52 |
+
'start': 100,
|
53 |
+
'end': 111},
|
54 |
+
{'entity_group': 'PER',
|
55 |
+
'score': 0.9841555754343668,
|
56 |
+
'word': 'Steve Jobs',
|
57 |
+
'start': 115,
|
58 |
+
'end': 126},
|
59 |
+
{'entity_group': 'PER',
|
60 |
+
'score': 0.9843501806259155,
|
61 |
+
'word': 'Steve Wozniak',
|
62 |
+
'start': 127,
|
63 |
+
'end': 141},
|
64 |
+
{'entity_group': 'PER',
|
65 |
+
'score': 0.9841533899307251,
|
66 |
+
'word': 'Ronald Wayne',
|
67 |
+
'start': 144,
|
68 |
+
'end': 157},
|
69 |
+
{'entity_group': 'ORG',
|
70 |
+
'score': 0.9468960364659628,
|
71 |
+
'word': 'Apple Computer',
|
72 |
+
'start': 243,
|
73 |
+
'end': 257}]
|
74 |
+
|
75 |
+
```
|
76 |
+
|
77 |
+
|
78 |
+
## Authors
|
79 |
+
|
80 |
+
|
81 |
+
|