yoda-ner / README.md
gazquez's picture
Update README.md
45dbd56
|
raw
history blame
No virus
854 Bytes
---
language:
- es
license: isc
library_name: flair
tags:
- flair
- token-classification
metrics:
- f1
- precision
- recall
- accuracy
widget:
- text: "Jean Paul Gaultier Classique - 50 ML Eau de Parfum Damen Parfum"
---
### Demo: How to use in Flair
Requires:
- **[Flair](https://github.com/flairNLP/flair/)** (`pip install flair`)
```python
from flair.data import Sentence
from flair.models import SequenceTagger
# load tagger
tagger = SequenceTagger.load("lighthousefeed/yoda-ner")
# make example sentence
sentence = Sentence("Jean Paul Gaultier Classique - 50 ML Eau de Parfum Damen Parfum.")
# predict NER tags
tagger.predict(sentence)
# print sentence
print(sentence)
# print predicted NER spans
print('The following NER tags are found:')
# iterate over entities and print
for entity in sentence.get_spans('ner'):
print(entity)
```