Model Overview
Model Features
Model Capabilities
Use Cases
đ Estonian NER model based on EstBERT
This model is a fine - tuned version of EstBERT, designed to accurately identify named entities in Estonian texts, offering high - precision NER capabilities.
đ Quick Start
This model is a fine - tuned version of tartuNLP/EstBERT on the Estonian NER dataset. It was trained by tartuNLP, the NLP research group at the institute of Computer Science at the University of Tartu.
It achieves the following results on the test set:
- Loss: 0.3565
- Precision: 0.7612
- Recall: 0.7744
- F1: 0.7678
- Accuracy: 0.9672
The entity - level results are as follows:
Precision | Recall | F1 | Number | |
---|---|---|---|---|
DATE | 0.7278 | 0.7258 | 0.7268 | 372 |
EVENT | 0.3721 | 0.5714 | 0.4507 | 28 |
GPE | 0.8679 | 0.8369 | 0.8521 | 840 |
LOC | 0.6545 | 0.4832 | 0.5560 | 149 |
MONEY | 0.6625 | 0.6023 | 0.6310 | 88 |
ORG | 0.6761 | 0.7267 | 0.7005 | 589 |
PER | 0.8255 | 0.9068 | 0.8642 | 751 |
PERCENT | 1.0 | 0.9589 | 0.9790 | 73 |
PROD | 0.6030 | 0.5430 | 0.5714 | 221 |
TIME | 0.5682 | 0.5556 | 0.5618 | 45 |
TITLE | 0.7 | 0.8063 | 0.7494 | 191 |
đģ Usage Examples
Basic Usage
from transformers import BertTokenizer, BertForTokenClassification
from transformers import pipeline
tokenizer = BertTokenizer.from_pretrained('tartuNLP/EstBERT_NER')
bertner = BertForTokenClassification.from_pretrained('tartuNLP/EstBERT_NER')
nlp = pipeline("ner", model=bertner, tokenizer=tokenizer)
text = "Kaia Kanepi (WTA 57.) langes USA-s Charlestonis toimuval WTA 500 kategooria tenniseturniiril konkurentsist kaheksandikfinaalis, kaotades poolatarile Magda Linette'ile (WTA 64.) 3 : 6, 6 : 4, 2 : 6."
ner_results = nlp(text)
tokens=tokenizer(text)
tokens=tokenizer.convert_ids_to_tokens(tokens['input_ids'])
print(f'tokens: {tokens}')
print(f'NER model:{ner_results}')
tokens: ['[CLS]', 'kai', '##a', 'kanepi', '(', 'w', '##ta', '57', '.', ')', 'langes', 'usa', '-', 's', 'cha', '##rl', '##est', '##onis', 'toimuval', 'w', '##ta', '500', 'kategooria', 'tennise', '##turniiril', 'konkurentsist', 'kaheksandik', '##finaalis', ',', 'kaotades', 'poola', '##tari', '##le', 'ma', '##gda', 'line', '##tte', "'", 'ile', '(', 'w', '##ta', '64', '.', ')', '3', ':', '6', ',', '6', ':', '4', ',', '2', ':', '6', '.', '[SEP]']
NER model: [{'entity': 'B-PER', 'score': 0.99999887, 'index': 1, 'word': 'kai', 'start': None, 'end': None}, {'entity': 'B-PER', 'score': 0.97371966, 'index': 2, 'word': '##a', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.99999815, 'index': 3, 'word': 'kanepi', 'start': None, 'end': None}, {'entity': 'B-ORG', 'score': 0.63085276, 'index': 5, 'word': 'w', 'start': None, 'end': None}, {'entity': 'B-GPE', 'score': 0.99999934, 'index': 11, 'word': 'usa', 'start': None, 'end': None}, {'entity': 'B-GPE', 'score': 0.9999685, 'index': 14, 'word': 'cha', 'start': None, 'end': None}, {'entity': 'I-GPE', 'score': 0.8875574, 'index': 15, 'word': '##rl', 'start': None, 'end': None}, {'entity': 'I-GPE', 'score': 0.9996168, 'index': 16, 'word': '##est', 'start': None, 'end': None}, {'entity': 'I-GPE', 'score': 0.9992657, 'index': 17, 'word': '##onis', 'start': None, 'end': None}, {'entity': 'B-EVENT', 'score': 0.99999064, 'index': 19, 'word': 'w', 'start': None, 'end': None}, {'entity': 'I-EVENT', 'score': 0.9772493, 'index': 20, 'word': '##ta', 'start': None, 'end': None}, {'entity': 'I-EVENT', 'score': 0.99999076, 'index': 21, 'word': '500', 'start': None, 'end': None}, {'entity': 'I-EVENT', 'score': 0.99955636, 'index': 22, 'word': 'kategooria', 'start': None, 'end': None}, {'entity': 'B-TITLE', 'score': 0.8771319, 'index': 30, 'word': 'poola', 'start': None, 'end': None}, {'entity': 'B-PER', 'score': 0.99999785, 'index': 33, 'word': 'ma', 'start': None, 'end': None}, {'entity': 'B-PER', 'score': 0.9998398, 'index': 34, 'word': '##gda', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.9999987, 'index': 35, 'word': 'line', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.9999976, 'index': 36, 'word': '##tte', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.99999285, 'index': 37, 'word': "'", 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.9999794, 'index': 38, 'word': 'ile', 'start': None, 'end': None}, {'entity': 'B-ORG', 'score': 0.7664479, 'index': 40, 'word': 'w', 'start': None, 'end': None}]
đ Documentation
Intended uses & limitations
This model can be used to find named entities from Estonian texts. The model is free to use for anyone. TartuNLP does not guarantee that the model is useful for anyone or anything. TartuNLP is not responsible for any results it generates.
Training and evaluation data
The model was trained on two Estonian NER datasets:
Both datasets have been annotated with the same annotation scheme. For training this model, the datasets were joined.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e - 05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 1024
- optimizer: Adam with betas=(0.9,0.98) and epsilon = 1e - 06
- lr_scheduler_type: polynomial
- max num_epochs: 150
- early stopping limit: 20
- early stopping tol: 0.0001
- mixed_precision_training: Native AMP
Training results
The final model was saved after epoch 53 (shown in bold) where the overall F1 was the highest on the development set.
Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy | Date Precision | Date Recall | Date F1 | Date Number | Event Precision | Event Recall | Event F1 | Event Number | Gpe Precision | Gpe Recall | Gpe F1 | Gpe Number | Loc Precision | Loc Recall | Loc F1 | Loc Number | Money Precision | Money Recall | Money F1 | Money Number | Org Precision | Org Recall | Org F1 | Org Number | Per Precision | Per Recall | Per F1 | Per Number | Percent Precision | Percent Recall | Percent F1 | Percent Number | Prod Precision | Prod Recall | Prod F1 | Prod Number | Time Precision | Time Recall | Time F1 | Time Number | Title Precision | Title Recall | Title F1 | Title Number | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0.3252 | 1 | 1061 | 0.1628 | 0.6835 | 0.6083 | 0.6437 | 0.9526 | 0.5910 | 0.6022 | 0.5965 | 372 | 0.0 | 0.0 | 0.0 | 28 | 0.8073 | 0.7631 | 0.7846 | 840 | 0.1389 | 0.0336 | 0.0541 | 149 | 0.4217 | 0.3977 | 0.4094 | 88 | 0.5381 | 0.5280 | 0.5330 | 589 | 0.7917 | 0.8655 | 0.8270 | 751 | 0.6471 | 0.3014 | 0.4112 | 73 | 0.2581 | 0.0724 | 0.1131 | 221 | 0.1429 | 0.0889 | 0.1096 | 45 | 0.7805 | 0.6702 | 0.7211 | 191 | 0.6835 | 0.6083 | 0.6437 | 0.9526 |
0.1513 | 2 | 2122 | 0.1332 | 0.6906 | 0.7329 | 0.7111 | 0.9615 | 0.6185 | 0.7366 | 0.6724 | 372 | 0.0857 | 0.1071 | 0.0952 | 28 | 0.7874 | 0.8595 | 0.8219 | 840 | 0.4767 | 0.2752 | 0.3489 | 149 | 0.6848 | 0.7159 | 0.7000 | 88 | 0.6158 | 0.6231 | 0.6194 | 589 | 0.7770 | 0.9001 | 0.8341 | 751 | 0.9565 | 0.9041 | 0.9296 | 73 | 0.5 | 0.3620 | 0.4199 | 221 | 0.3571 | 0.3333 | 0.3448 | 45 | 0.6033 | 0.7644 | 0.6744 | 191 | 0.6906 | 0.7329 | 0.7111 | 0.9615 |
0.1131 | 3 | 3183 | 0.1281 | 0.7224 | 0.7338 | 0.7280 | 0.9638 | 0.7054 | 0.7339 | 0.7194 | 372 | 0.1053 | 0.1429 | 0.1212 | 28 | 0.8013 | 0.85 | 0.8250 | 840 | 0.5476 | 0.3087 | 0.3948 | 149 | 0.6386 | 0.6023 | 0.6199 | 88 | 0.6371 | 0.6469 | 0.6420 | 589 | 0.8235 | 0.8762 | 0.8490 | 751 | 0.9859 | 0.9589 | 0.9722 | 73 | 0.5148 | 0.3937 | 0.4462 | 221 | 0.5116 | 0.4889 | 0.5 | 45 | 0.6245 | 0.7749 | 0.6916 | 191 | 0.7224 | 0.7338 | 0.7280 | 0.9638 |
0.0884 | 4 | 4244 | 0.1354 | 0.7283 | 0.7386 | 0.7334 | 0.9639 | 0.6785 | 0.6694 | 0.6739 | 372 | 0.1795 | 0.25 | 0.2090 | 28 | 0.8231 | 0.8310 | 0.8270 | 840 | 0.6020 | 0.3960 | 0.4777 | 149 | 0.6092 | 0.6023 | 0.6057 | 88 | 0.6473 | 0.7012 | 0.6732 | 589 | 0.8351 | 0.8628 | 0.8487 | 751 | 1.0 | 0.9726 | 0.9861 | 73 | 0.5899 | 0.4751 | 0.5263 | 221 | 0.4524 | 0.4222 | 0.4368 | 45 | 0.6 | 0.7853 | 0.6803 | 191 | 0.7283 | 0.7386 | 0.7334 | 0.9639 |
0.0685 | 5 | 5305 | 0.1383 | 0.7224 | 0.7696 | 0.7453 | 0.9644 | 0.6635 | 0.7473 | 0.7029 | 372 | 0.26 | 0.4643 | 0.3333 | 28 | 0.8259 | 0.8357 | 0.8308 | 840 | 0.5913 | 0.4564 | 0.5152 | 149 | 0.6437 | 0.6364 | 0.64 | 88 | 0.6540 | 0.7284 | 0.6892 | 589 | 0.8070 | 0.8961 | 0.8492 | 751 | 0.9857 | 0.9452 | 0.9650 | 73 | 0.5693 | 0.5204 | 0.5437 | 221 | 0.5192 | 0.6 | 0.5567 | 45 | 0.6320 | 0.7644 | 0.6919 | 191 | 0.7224 | 0.7696 | 0.7453 | 0.9644 |
0.0532 | 6 | 6366 | 0.1493 | 0.7099 | 0.7613 | 0.7347 | 0.9631 | 0.6727 | 0.6962 | 0.6843 | 372 | 0.2308 | 0.5357 | 0.3226 | 28 | 0.8242 | 0.8262 | 0.8252 | 840 | 0.5877 | 0.4497 | 0.5095 | 149 | 0.6410 | 0.5682 | 0.6024 | 88 | 0.6232 | 0.7470 | 0.6795 | 589 | 0.8087 | 0.8895 | 0.8472 | 751 | 0.9672 | 0.8082 | 0.8806 | 73 | 0.5107 | 0.5385 | 0.5242 | 221 | 0.6190 | 0.5778 | 0.5977 | 45 | 0.6371 | 0.7906 | 0.7056 | 191 | 0.7099 | 0.7613 | 0.7347 | 0.9631 |
0.0403 | 7 | 7427 | 0.1592 | 0.7239 | 0.7592 | 0.7411 | 0.9642 | 0.6923 | 0.7016 | 0.6969 | 372 | 0.2857 | 0.5714 | 0.3810 | 28 | 0.8272 | 0.8262 | 0.8267 | 840 | 0.5752 | 0.4362 | 0.4962 | 149 | 0.6265 | 0.5909 | 0.6082 | 88 | 0.6402 | 0.6978 | 0.6677 | 589 | 0.8404 | 0.8762 | 0.8579 | 751 | 0.9859 | 0.9589 | 0.9722 | 73 | 0.5257 | 0.6018 | 0.5612 | 221 | 0.5870 | 0.6 | 0.5934 | 45 | 0.6235 | 0.8063 | 0.7032 | 191 |
đ License
This project is licensed under the CC - BY 4.0 license.






