Views
No views yet
| Hyper-Parameter | Value |
|---|---|
| Batch Size | 4 |
| Learning Rate | 5-06 |
| Max. Epochs | 10 |
| Seed 1 | Seed 2 | Seed 3 | Seed 4 | Seed 5 | Avg. |
|---|---|---|---|---|---|
| (97.34) / 97.00 | (97.26) / 96.90 | (97.66) / 97.02 | (97.42) / 96.96 | (97.46) / 96.99 | (97.43) / 96.97 |
1from flair.data import Sentence
2from flair.models import SequenceTagger
3
4# load tagger
5tagger = SequenceTagger.load("stefan-it/flair-clean-conll-5")
6
7# make example sentence
8sentence = Sentence("According to the BBC George Washington went to Washington.")
9
10# predict NER tags
11tagger.predict(sentence)
12
13# print sentence
14print(sentence)
15
16# print predicted NER spans
17print('The following NER tags are found:')
18# iterate over entities and print
19for entity in sentence.get_spans('ner'):
20 print(entity)