|
--- |
|
language: |
|
- fr |
|
pipeline_tag: token-classification |
|
library_name: flair |
|
--- |
|
|
|
## Rapido's project Model |
|
|
|
### |
|
This model was trained with and meant to be used with datas from Rapido project. |
|
The package flair was used for the training. The following versions of Flair and Transformers are required : |
|
- transformers == 4.41.2 |
|
- flair == 0.10 |
|
### How to use |
|
|
|
```python |
|
from flair.models import SequenceTagger |
|
from flair.data import Sentence |
|
|
|
tagger = SequenceTagger.load('rapido-model.pt') |
|
your_sentence = "Put your sentence here" |
|
sentence = Sentence(your_sentence) |
|
self.tagger.predict(sentences) |
|
for sentence in sentences: |
|
for entity in sentence.get_spans('ner'): |
|
if entity.tag == "LOC": |
|
entity_txt = entity.text #get the entity |
|
entity_score = '%.3f' % entity.score #get the score |
|
print(entity_txt,score) |
|
|
|
``` |
|
|
|
### Validation score |
|
|
|
precision recall f1-score support |
|
|
|
LOC 0.8790 0.8563 0.8675 891 |
|
|
|
### For more information |
|
|
|
- https://github.com/Inist-CNRS/web-services/blob/main/services/data-rapido/README.md |