Upload 8 files
Browse files- config.json +77 -0
- model.safetensors +3 -0
- readme.md +138 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +59 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
config.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertForTokenClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"dtype": "float32",
|
| 8 |
+
"eos_token_ids": 0,
|
| 9 |
+
"gradient_checkpointing": false,
|
| 10 |
+
"hidden_act": "gelu",
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"id2label": {
|
| 14 |
+
"0": "O",
|
| 15 |
+
"1": "B-PER",
|
| 16 |
+
"2": "I-PER",
|
| 17 |
+
"3": "B-ORG",
|
| 18 |
+
"4": "I-ORG",
|
| 19 |
+
"5": "B-LOC",
|
| 20 |
+
"6": "I-LOC",
|
| 21 |
+
"7": "B-GPE",
|
| 22 |
+
"8": "I-GPE",
|
| 23 |
+
"9": "B-PROD",
|
| 24 |
+
"10": "I-PROD",
|
| 25 |
+
"11": "B-TITLE",
|
| 26 |
+
"12": "I-TITLE",
|
| 27 |
+
"13": "B-EVENT",
|
| 28 |
+
"14": "I-EVENT",
|
| 29 |
+
"15": "B-DATE",
|
| 30 |
+
"16": "I-DATE",
|
| 31 |
+
"17": "B-TIME",
|
| 32 |
+
"18": "I-TIME",
|
| 33 |
+
"19": "B-MONEY",
|
| 34 |
+
"20": "I-MONEY",
|
| 35 |
+
"21": "B-PERCENT",
|
| 36 |
+
"22": "I-PERCENT"
|
| 37 |
+
},
|
| 38 |
+
"initializer_range": 0.02,
|
| 39 |
+
"intermediate_size": 3072,
|
| 40 |
+
"label2id": {
|
| 41 |
+
"B-DATE": 15,
|
| 42 |
+
"B-EVENT": 13,
|
| 43 |
+
"B-GPE": 7,
|
| 44 |
+
"B-LOC": 5,
|
| 45 |
+
"B-MONEY": 19,
|
| 46 |
+
"B-ORG": 3,
|
| 47 |
+
"B-PER": 1,
|
| 48 |
+
"B-PERCENT": 21,
|
| 49 |
+
"B-PROD": 9,
|
| 50 |
+
"B-TIME": 17,
|
| 51 |
+
"B-TITLE": 11,
|
| 52 |
+
"I-DATE": 16,
|
| 53 |
+
"I-EVENT": 14,
|
| 54 |
+
"I-GPE": 8,
|
| 55 |
+
"I-LOC": 6,
|
| 56 |
+
"I-MONEY": 20,
|
| 57 |
+
"I-ORG": 4,
|
| 58 |
+
"I-PER": 2,
|
| 59 |
+
"I-PERCENT": 22,
|
| 60 |
+
"I-PROD": 10,
|
| 61 |
+
"I-TIME": 18,
|
| 62 |
+
"I-TITLE": 12,
|
| 63 |
+
"O": 0
|
| 64 |
+
},
|
| 65 |
+
"layer_norm_eps": 1e-12,
|
| 66 |
+
"max_position_embeddings": 512,
|
| 67 |
+
"model_type": "bert",
|
| 68 |
+
"num_attention_heads": 12,
|
| 69 |
+
"num_hidden_layers": 12,
|
| 70 |
+
"output_past": true,
|
| 71 |
+
"pad_token_id": 0,
|
| 72 |
+
"position_embedding_type": "absolute",
|
| 73 |
+
"transformers_version": "4.57.3",
|
| 74 |
+
"type_vocab_size": 2,
|
| 75 |
+
"use_cache": true,
|
| 76 |
+
"vocab_size": 50000
|
| 77 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fac4ed3fbb3bbf7a4684f46c54d16cc9db87b55decefa55f1453c4dfcbb7f5c5
|
| 3 |
+
size 495497116
|
readme.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Estonian NER Model - Fine-tuned on Synthetic Government Data
|
| 2 |
+
|
| 3 |
+
This model is a domain-adapted version of [tartuNLP/EstBERT_NER_v2](https://huggingface.co/tartuNLP/EstBERT_NER_v2), further fine-tuned on synthetically generated Estonian text focusing on government services and public administration communications.
|
| 4 |
+
|
| 5 |
+
## Model Description
|
| 6 |
+
|
| 7 |
+
**Base Model:** tartuNLP/EstBERT_NER_v2
|
| 8 |
+
**Language:** Estonian (et)
|
| 9 |
+
**Task:** Token Classification (Named Entity Recognition)
|
| 10 |
+
**Training Data:** Synthetic data generated using Google Gemini-3-pro API
|
| 11 |
+
|
| 12 |
+
This model specializes in extracting named entities from Estonian government and public service-related text, including citizen communications with government agencies.
|
| 13 |
+
|
| 14 |
+
## Supported Entity Types
|
| 15 |
+
|
| 16 |
+
The model recognizes 11 entity types:
|
| 17 |
+
|
| 18 |
+
- **PER**: Person names
|
| 19 |
+
- **ORG**: Organizations, companies, government agencies
|
| 20 |
+
- **LOC**: Locations, addresses, streets, buildings
|
| 21 |
+
- **GPE**: Geopolitical entities (cities, counties, countries)
|
| 22 |
+
- **PROD**: Products
|
| 23 |
+
- **TITLE**: Titles, positions
|
| 24 |
+
- **EVENT**: Events
|
| 25 |
+
- **DATE**: Dates
|
| 26 |
+
- **TIME**: Time expressions
|
| 27 |
+
- **MONEY**: Monetary values
|
| 28 |
+
- **PERCENT**: Percentages
|
| 29 |
+
|
| 30 |
+
Each entity uses BIO tagging (B- for beginning, I- for inside).
|
| 31 |
+
|
| 32 |
+
## Training Data
|
| 33 |
+
|
| 34 |
+
The model was fine-tuned on synthetically generated data created specifically for Estonian government and public service domains. The synthetic dataset includes:
|
| 35 |
+
|
| 36 |
+
- **Generation Method**: Google Gemini-3-pro API with structured prompts
|
| 37 |
+
- **Domain Coverage**: 22+ Estonian government agencies including Töötukassa (Unemployment Insurance Fund), Maksu- ja Tolliamet (Tax and Customs Board), Politsei- ja Piirivalveamet (Police and Border Guard), and others
|
| 38 |
+
- **Topics**: Various government services like unemployment benefits, tax declarations, social insurance, permits, registrations, etc.
|
| 39 |
+
- **Style Diversity**: Multiple writing styles (formal, casual, shorthand, mixed) to improve robustness
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
### Why Synthetic Data?
|
| 43 |
+
|
| 44 |
+
Synthetic data generation allowed us to:
|
| 45 |
+
1. Create domain-specific training examples for government services
|
| 46 |
+
2. Ensure comprehensive coverage of Estonian public sector terminology
|
| 47 |
+
3. Include diverse writing styles found in citizen-government communications
|
| 48 |
+
4. Control entity distribution and annotation quality
|
| 49 |
+
|
| 50 |
+
## Training Details
|
| 51 |
+
|
| 52 |
+
- **Base Model**: tartuNLP/EstBERT_NER_v2
|
| 53 |
+
- **Training Epochs**: 10
|
| 54 |
+
- **Batch Size**: 16
|
| 55 |
+
- **Learning Rate**: 5e-5
|
| 56 |
+
- **Max Sequence Length**: 512 tokens
|
| 57 |
+
- **Optimizer**: AdamW (weight decay: 0.01)
|
| 58 |
+
- **Training Framework**: Hugging Face Transformers + PyTorch
|
| 59 |
+
|
| 60 |
+
## Usage
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from transformers import BertTokenizerFast, BertForTokenClassification
|
| 64 |
+
from transformers import pipeline
|
| 65 |
+
|
| 66 |
+
# Load model and tokenizer
|
| 67 |
+
tokenizer = BertTokenizerFast.from_pretrained('buerokratt/{model_name}')
|
| 68 |
+
model = BertForTokenClassification.from_pretrained('buerokratt/{model_name}')
|
| 69 |
+
|
| 70 |
+
# Create NER pipeline
|
| 71 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 72 |
+
|
| 73 |
+
# Example text
|
| 74 |
+
text = ""
|
| 75 |
+
|
| 76 |
+
# Get predictions
|
| 77 |
+
ner_results = nlp(text)
|
| 78 |
+
|
| 79 |
+
for entity in ner_results:
|
| 80 |
+
print(f"{entity['word']}: {entity['entity']}")
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
### Overall Metrics
|
| 85 |
+
|
| 86 |
+
| Metric | Score |
|
| 87 |
+
|--------|-------|
|
| 88 |
+
| **Micro F1-Score** | 0.8544 |
|
| 89 |
+
| **Macro F1-Score** | 0.8561 |
|
| 90 |
+
| **Micro Precision** | 0.8404|
|
| 91 |
+
| **Micro Recall** | 0.8689 |
|
| 92 |
+
|
| 93 |
+
### Per-Entity Performance
|
| 94 |
+
|
| 95 |
+
| Entity | Precision | Recall | F1-Score |
|
| 96 |
+
|--------|-----------|--------|----------|
|
| 97 |
+
| **GPE** | 0.7778 | 0.7925 | 0.7850 |
|
| 98 |
+
| **LOC** | 0.9796 | 0.9412 | 0.9600 |
|
| 99 |
+
| **ORG** | 0.7778 | 0.8077 | 0.7925 |
|
| 100 |
+
| **PER** | 0.8393 | 0.9400 | 0.8868 |
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
## Intended Use
|
| 104 |
+
|
| 105 |
+
This model is optimized for:
|
| 106 |
+
- Processing Estonian government service inquiries
|
| 107 |
+
- Extracting entities from citizen communications
|
| 108 |
+
- Analyzing public administration texts
|
| 109 |
+
- Information extraction from Estonian bureaucratic documents
|
| 110 |
+
|
| 111 |
+
## Limitations
|
| 112 |
+
|
| 113 |
+
- **Domain Specificity**: Optimized for government/public service text; may underperform on other domains
|
| 114 |
+
- **Synthetic Training Data**: While diverse, synthetic data may not capture all real-world linguistic variations
|
| 115 |
+
- **Base Model Limitations**: Inherits limitations from EstBERT_NER_v2
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
## Citation
|
| 119 |
+
|
| 120 |
+
If you use this model, please cite the base EstBERT_NER model:
|
| 121 |
+
|
| 122 |
+
```bibtex
|
| 123 |
+
@misc{tanvir2020estbert,
|
| 124 |
+
title={EstBERT: A Pretrained Language-Specific BERT for Estonian},
|
| 125 |
+
author={Hasan Tanvir and Claudia Kittask and Kairit Sirts},
|
| 126 |
+
year={2020},
|
| 127 |
+
eprint={2011.04784},
|
| 128 |
+
archivePrefix={arXiv},
|
| 129 |
+
primaryClass={cs.CL}
|
| 130 |
+
}
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
## Acknowledgments
|
| 134 |
+
|
| 135 |
+
- **Base Model**: [tartuNLP/EstBERT_NER_v2](https://huggingface.co/tartuNLP/EstBERT_NER_v2) by the NLP research group at the University of Tartu
|
| 136 |
+
- **Synthetic Data Generation**: Google Gemini-3-pro API
|
| 137 |
+
- **Training Framework**: Hugging Face Transformers
|
| 138 |
+
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"mask_token": "[MASK]",
|
| 4 |
+
"pad_token": "[PAD]",
|
| 5 |
+
"sep_token": "[SEP]",
|
| 6 |
+
"unk_token": "[UNK]"
|
| 7 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "[UNK]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "[CLS]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "[SEP]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"4": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"clean_up_tokenization_spaces": true,
|
| 45 |
+
"cls_token": "[CLS]",
|
| 46 |
+
"do_basic_tokenize": true,
|
| 47 |
+
"do_lower_case": true,
|
| 48 |
+
"extra_special_tokens": {},
|
| 49 |
+
"full_tokenizer_file": null,
|
| 50 |
+
"mask_token": "[MASK]",
|
| 51 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 52 |
+
"never_split": null,
|
| 53 |
+
"pad_token": "[PAD]",
|
| 54 |
+
"sep_token": "[SEP]",
|
| 55 |
+
"strip_accents": null,
|
| 56 |
+
"tokenize_chinese_chars": true,
|
| 57 |
+
"tokenizer_class": "BertTokenizer",
|
| 58 |
+
"unk_token": "[UNK]"
|
| 59 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5cf00e8b082841964594b63f61be358d3d2e9b0aff969c52544197526d8f5c95
|
| 3 |
+
size 5368
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|