Downloads · 30 days
0
0% of all-time downloads
regel-corpus/hunflair2-ner
hunflair2-ner is a token classification model from regel-corpus. Use it when you need labels on individual words, such as names. It is set up for flair.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
30
Public
Repo size
434 MB
Likes
0
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.nn import Classifier
from flair.tokenization import SciSpacyTokenizer
# load tagger
tagger = Classifier.load("regel-corpus/hunflair2-regel-tissue")
# make example sentence
sentence = Sentence("TNF-like factor that is both produced by osteoblasts, mesenchymal cells, "
"and activated T cells and required for osteoclast maturation and survival."
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)