CoolFace
Modelpublic

grammatek/icelandic-ner-bert

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes573downloads
Model Card

IcelandicNER BERT

This model was fine-tuned on the MIM-GOLD-NER dataset for the Icelandic language. The MIM-GOLD-NER corpus was developed at Reykjavik University in 2018–2020 that covered eight types of entities:

  • —Date
  • —Location
  • —Miscellaneous
  • —Money
  • —Organization
  • —Percent
  • —Person
  • —Time

Dataset Information

RecordsB-DateB-LocationB-MiscellaneousB-MoneyB-OrganizationB-PercentB-PersonB-TimeI-DateI-LocationI-MiscellaneousI-MoneyI-OrganizationI-PercentI-PersonI-Time
Train39988340959804351729575450211719868211251630367702382505478790
Valid7063570103478710010781032106147409765601044587998136
Test8299779131993515313151082247172483104660167617101089158

Evaluation

The following tables summarize the scores obtained by model overall and per each class.

entityprecisionrecallf1-scoresupport
Date0.9694660.9781770.973802779.0
Location0.9552010.9537530.9544761319.0
Miscellaneous0.8670330.8438500.855285935.0
Money0.9797300.9477120.963455153.0
Organization0.8939390.8973380.8956361315.0
Percent1.0000001.0000001.000000108.0
Person0.9630280.9737430.9683562247.0
Time0.9768790.9825580.979710172.0
micro avg0.9381580.9389580.9385587028.0
macro avg0.9506590.9471410.9488407028.0
weighted avg0.9378450.9389580.9383637028.0

How To Use

You use this model with Transformers pipeline for NER.

Installing requirements

bash
pip install transformers

How to predict using pipeline

python
from transformers import AutoTokenizer
from transformers import AutoModelForTokenClassification  # for pytorch
from transformers import TFAutoModelForTokenClassification  # for tensorflow
from transformers import pipeline


model_name_or_path = "grammatek/icelandic-ner-bert" 
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
model = AutoModelForTokenClassification.from_pretrained(model_name_or_path)  # Pytorch
# model = TFAutoModelForTokenClassification.from_pretrained(model_name_or_path)  # Tensorflow

nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "Kristin manneskja getur ekki lagt frásagnir af Jesú Kristi á hilluna vegna þess að hún sé búin að lesa þær ."

ner_results = nlp(example)
print(ner_results)

Questions?

Post a Github issue on the IcelandicNER Issues repo.