Update README.md
Browse files
README.md
CHANGED
|
@@ -3,4 +3,40 @@ language:
|
|
| 3 |
- fr
|
| 4 |
pipeline_tag: token-classification
|
| 5 |
library_name: flair
|
| 6 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
- fr
|
| 4 |
pipeline_tag: token-classification
|
| 5 |
library_name: flair
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## Rapido's project Model
|
| 9 |
+
|
| 10 |
+
###
|
| 11 |
+
This model was trained with and meant to be used with datas from Rapido project.
|
| 12 |
+
The package flair was used for the training. The following versions of Flair and Transformers are required :
|
| 13 |
+
- transformers == 4.41.2
|
| 14 |
+
- flair == 0.10
|
| 15 |
+
### How to use
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
from flair.models import SequenceTagger
|
| 19 |
+
from flair.data import Sentence
|
| 20 |
+
|
| 21 |
+
tagger = SequenceTagger.load('rapido-model.pt')
|
| 22 |
+
your_sentence = "Put your sentence here"
|
| 23 |
+
sentence = Sentence(your_sentence)
|
| 24 |
+
self.tagger.predict(sentences)
|
| 25 |
+
for sentence in sentences:
|
| 26 |
+
for entity in sentence.get_spans('ner'):
|
| 27 |
+
if entity.tag == "LOC":
|
| 28 |
+
entity_txt = entity.text #get the entity
|
| 29 |
+
entity_score = '%.3f' % entity.score #get the score
|
| 30 |
+
print(entity_txt,score)
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### Validation score
|
| 35 |
+
|
| 36 |
+
precision recall f1-score support
|
| 37 |
+
|
| 38 |
+
LOC 0.8790 0.8563 0.8675 891
|
| 39 |
+
|
| 40 |
+
### For more information
|
| 41 |
+
|
| 42 |
+
- https://github.com/Inist-CNRS/web-services/blob/main/services/data-rapido/README.md
|