German NER in Flair (4-class)

This is the 4-class NER model for German for Flair.

F1-Score: 97.38

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 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-german-4class")

# make example sentence
sentence = Sentence("Die Deutsche Nationalmannschaft, trainiert von Helmut Schön, gewann in München bei der Weltmeisterschaft 1974 das Endspiel gegen die Niederlande.")

# 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[1:3]: "Deutsche Nationalmannschaft" → ORG (1.0000)
Span[6:8]: "Helmut Schön" → PER (1.0000)
Span[11:12]: "München" → LOC (1.0000)
Span[14:16]: "Weltmeisterschaft 1974" → MISC (1.0000)
Span[20:21]: "Niederlande" → ORG (1.0000)

So, the entities "Deutsche Nationalmannschaft" and "Niederlande" are tagged as organization (soccer teams), "Helmut Schön" is tagged as a person, "Mexico" as a location and "*, together with the entity "Weltmeisterschaft 1974", labeled as other (miscellaneous, MISC).


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
13
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including flair/entity-german-4class