Downloads · 30 days
6
3% of all-time downloads
stefan-it/flair-clean-conll-2
flair-clean-conll-2 is a token classification model from stefan-it. Use it when you need labels on individual words, such as names. It is set up for flair.
This (unofficial) Flair NER model was trained on the awesome CleanCoNLL dataset.
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
221
Public
Repo size
2.3 GB
Likes
0
Public
Click a slice to open those files.
.bin2.3 GB · 100%
From the Hugging Face model README
This (unofficial) Flair NER model was trained on the awesome CleanCoNLL dataset.
The CleanCoNLL dataset was proposed by Susanna Rücker and Alan Akbik and introduces a corrected version of the classic CoNLL-03 dataset, with updated and more consistent NER labels.
We use XLM-RoBERTa Large as backbone language model and the following hyper-parameters for fine-tuning:
| Hyper-Parameter | Value |
|---|---|
| Batch Size | 4 |
| Learning Rate | 5-06 |
| Max. Epochs | 10 |
Additionally, the FLERT approach is used for fine-tuning the model. Training logs and TensorBoard are also available for each model.
We report micro F1-Score on development (in brackets) and test set for five runs with different seeds:
| Seed 1 | Seed 2 | Seed 3 | Seed 4 | Seed 5 | Avg. |
|---|---|---|---|---|---|
| (97.34) / 97.00 | (97.26) / 96.90 | (97.66) / 97.02 | (97.42) / 96.96 | (97.46) / 96.99 | (97.43) / 96.97 |
Rücker and Akbik report 96.98 on three different runs, so our results are very close to their reported performance!
The following snippet shows how to use the CleanCoNLL NER models with Flair:
from flair.data import Sentence
from flair.models import SequenceTagger
# load tagger
tagger = SequenceTagger.load("stefan-it/flair-clean-conll-2")
# make example sentence
sentence = Sentence("According to the BBC George Washington went to Washington.")
# 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)