flair/ner-english-large
5456k
English NER (7 classes) — Flukes
Named entity recognition for English text. Predicts seven entity types:
⚠️ 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@hu-berlin.de.Use
Install flukes:
pip install flukesThen:
from flukes.models import Model
# load the named entity recognition (NER) model
model = Model.load("ner")
# the text you would like to tag
text = "Washington bought himself a pair of Nike Vaporflys.\n\nHe wore them at the Berlin Marathon."
# predict tags for the model
doc = model.predict(text)
# print the document with tags
print(doc)Output:
Document[89]: Washington bought himself a pair of Nike Vaporflys.
╰───PER──╯ ╰───PRODUCT──╯
He wore them at the Berlin Marathon.
╰────EVENT────╯Access Annotations
You can also access all annotations directly:
from flukes.models import Model
# load the named entity recognition (NER) model
model = Model.load("ner")
# the text you would like to tag
text = "Washington bought himself a pair of Nike Vaporflys.\n\nHe wore them at the Berlin Marathon."
# predict tags for the model
doc = model.predict(text)
# iterate over spans and print information
for span in doc.spans:
print(f"{span.text!r:30} {span.label} ({span.score:.2f})")
Output:
'Washington' PER (1.00)
'Nike Vaporflys' PRODUCT (1.00)
'Berlin Marathon' EVENT (1.00)Performance
This model scores 96.1 F1 on our internal test sets.
License
Model weights: Flukes Noncommercial License 1.0. Personal, academic, and other noncommercial use permitted. Commercial use requires a separate license — contact alan.akbik@hu-berlin.de.
Flukes library code: Apache 2.0.
