Update README.md
Browse files
README.md
CHANGED
@@ -22,16 +22,22 @@ Requires:
|
|
22 |
```python
|
23 |
from flair.data import Sentence
|
24 |
from flair.models import SequenceTagger
|
|
|
25 |
# load tagger
|
26 |
tagger = SequenceTagger.load("{repo_id}")
|
|
|
27 |
# make example sentence
|
28 |
sentence = Sentence("Jean Paul Gaultier Classique - 50 ML Eau de Parfum Damen Parfum.")
|
|
|
29 |
# predict NER tags
|
30 |
tagger.predict(sentence)
|
|
|
31 |
# print sentence
|
32 |
print(sentence)
|
|
|
33 |
# print predicted NER spans
|
34 |
print('The following NER tags are found:')
|
|
|
35 |
# iterate over entities and print
|
36 |
for entity in sentence.get_spans('ner'):
|
37 |
print(entity)
|
|
|
22 |
```python
|
23 |
from flair.data import Sentence
|
24 |
from flair.models import SequenceTagger
|
25 |
+
|
26 |
# load tagger
|
27 |
tagger = SequenceTagger.load("{repo_id}")
|
28 |
+
|
29 |
# make example sentence
|
30 |
sentence = Sentence("Jean Paul Gaultier Classique - 50 ML Eau de Parfum Damen Parfum.")
|
31 |
+
|
32 |
# predict NER tags
|
33 |
tagger.predict(sentence)
|
34 |
+
|
35 |
# print sentence
|
36 |
print(sentence)
|
37 |
+
|
38 |
# print predicted NER spans
|
39 |
print('The following NER tags are found:')
|
40 |
+
|
41 |
# iterate over entities and print
|
42 |
for entity in sentence.get_spans('ner'):
|
43 |
print(entity)
|