Downloads · 30 days
3.5K
2% of all-time downloads
hunflair/hunflair2-ner
hunflair2-ner is a token classification model from hunflair. Use it when you need labels on individual words, such as names. It is set up for flair.
Requires: - Flair=0.14.0 (pip install flair or pip install git+https://github.com/flairNLP/flair.git)
Downloads · 30 days
3.5K
2% of all-time downloads
All-time downloads
200K
Public
Repo size
1.3 GB
Likes
2
Public
Click a slice to open those files.
.bin434 MB · 100%
From the Hugging Face model README
Requires:
pip install flair or pip install git+https://github.com/flairNLP/flair.git)from flair.data import Sentence
from flair.models.prefixed_tagger import PrefixedSequenceTagger
from flair.tokenization import SciSpacyTokenizer
# load tagger
tagger = PrefixedSequenceTagger.load("hunflair/hunflair2-ner")
# make example sentence
sentence = Sentence("The mutation in the ABCD1 gene causes X-linked adrenoleukodystrophy, "
"a neurodegenerative disease, which is exacerbated by exposure to high "
"levels of mercury in dolphin populations.",
use_tokenizer=SciSpacyTokenizer())
# 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)