Instructions to use flair/entity-english-8class with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Flair
How to use flair/entity-english-8class with Flair:
from flair.models import SequenceTagger tagger = SequenceTagger.load("flair/entity-english-8class") - Notebooks
- Google Colab
- Kaggle
English NER in Flair (8-class)
This is the 8-class NER model for English for Flair.
F1-Score: 95.9
Predicts 8 tags:
| tag | meaning |
|---|---|
| PER | person name |
| LOC | location name |
| ORG | organization name |
| PRODUCT | product name ("Oura Ring 5") |
| WORK_OF_ART | film/song/album/book name |
| EVENT | named event ("1970 World Cup") |
| IDENT | nationality, ethnicity or adherence |
| 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
alan.akbik@gmail.com.
Demo: How to use in Flair
Requires: Flair (pip install flair)
from flair.data import Sentence
from flair.models import SequenceTagger
# load tagger
tagger = SequenceTagger.load("flair/entity-english-8class")
# 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" → EVENT (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 event.
Cite
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}
}
License
Model weights: Flukes Noncommercial License 1.0.
Personal, academic, and other noncommercial use permitted. Commercial use
requires a separate license — contact alan.akbik@gmail.com.
- Downloads last month
- 7