Inquirer_ner / README.md
Saisam's picture
Update README.md
299cf95
|
raw
history blame
680 Bytes
metadata
tags:
  - flair
  - token-classification
  - sequence-tagger-model
language: en
datasets:
  - conll2003
license: afl-3.0

Requires: Flair (pip install flair)

from flair.data import Sentence
from flair.models import SequenceTagger
# load tagger
tagger = SequenceTagger.load("Saisam/Inquirer_ner")
# make example sentence
sentence = Sentence("George Washington went to Washington")
# 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)