File size: 854 Bytes
038c219
9b71a49
 
914ff64
 
9b71a49
 
6a04f01
914ff64
 
 
 
 
4508aef
 
038c219
8f49c81
 
 
 
79cd545
8f49c81
 
 
889a9b5
8f49c81
45dbd56
889a9b5
8f49c81
 
889a9b5
8f49c81
 
889a9b5
8f49c81
 
889a9b5
8f49c81
 
889a9b5
8f49c81
 
 
79cd545
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
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)
```