Downloads · 30 days
122
100% of all-time downloads
flair/entity-english-4class
entity-english-4class is a token classification model from flair. Use it when you need labels on individual words, such as names. It is set up for flair. The card lists the license as other.
This is the 4-class NER model for English for Flair.
Downloads · 30 days
122
100% of all-time downloads
All-time downloads
122
Public
Repo size
5.3 GB
Likes
0
Public
Click a slice to open those files.
.bin744 MB · 100%
From the Hugging Face model README
This is the 4-class NER model for English for Flair.
F1-Score: 95.6
Predicts 4 tags:
| tag | meaning |
|---|---|
| PER | person name |
| LOC | location name |
| ORG | organization name |
| MISC | other name |
⚠️ Default license: noncommercial use only. This model is released under the Flukes NC 1.0 License. Commercial use — including using this model's predictions in a commercial product or service — requires a separate license. Contact
[email protected].
Requires: Flair (pip install flair)
from flair.data import Sentence
from flair.models import SequenceTagger
# load tagger
tagger = SequenceTagger.load("flair/entity-english-4class")
# make example sentence
sentence = Sentence("Santos star Pelé won the 1970 World Cup in Mexico.")
# 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)
This yields the following output:
Span[0:1]: "Santos" → ORG (1.0000)
Span[2:3]: "Pelé" → PER (1.0000)
Span[5:8]: "1970 World Cup" → MISC (1.0000)
Span[9:10]: "Mexico" → LOC (1.0000)
So, the entities "Santos" (team name labeled as a organization), "Pelé" (labeled as a person), "Mexico" (labeled as a location) are found, together with the entity "1970 World Cup", labeled as other (miscellaneous, MISC).
Please cite the following paper when using this model.
@inproceedings{akbik2019flair,
title={{FLAIR}: An easy-to-use framework for state-of-the-art {NLP}},
author={Akbik, Alan and Bergmann, Tanja and Blythe, Duncan and Rasul, Kashif and Schweter, Stefan and Vollgraf, Roland},
booktitle={{NAACL} 2019, 2019 Annual Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)},
pages={54--59},
year={2019}
}
Model weights: Flukes Noncommercial License 1.0.
Personal, academic, and other noncommercial use permitted. Commercial use
requires a separate license — contact [email protected].