This model is a fine-tuned version of mBERT (Multilingual BERT) for Named Entity Recognition (NER) in the Azerbaijani language. It recognizes several entity types commonly used in Azerbaijani text, providing solid performance on tasks requiring entity extraction, such as personal names, locations, organizations, and dates.
Dataset: Custom Azerbaijani NER dataset with entity tags such as PERSON, LOCATION, ORGANISATION, DATE, etc.
Data Source
The model was trained on the Azerbaijani NER Dataset, which provides annotated data with 25 distinct entity types specifically for the Azerbaijani language. This dataset is an invaluable resource for improving NLP tasks in Azerbaijani, including entity recognition and language understanding.
Entity Types
The model recognizes the following entities:
PERSON: Names of people
LOCATION: Geographical locations
ORGANISATION: Companies, institutions
DATE: Dates and periods
MONEY: Monetary values
TIME: Time expressions
GPE: Countries, cities, states
FACILITY: Buildings, landmarks, etc.
EVENT: Events and occurrences
...and more
For the full list of entities, please refer to the dataset description.
Performance Metrics
Epoch-wise Performance
Epoch
Training Loss
Validation Loss
Precision
Recall
F1
Accuracy
1
0.295200
0.265711
0.715424
0.622853
0.665937
0.919136
2
0.248600
0.252083
0.721036
0.637979
0.676970
0.921439
3
0.206800
0.253372
0.704872
0.650684
0.676695
0.920898
Evaluation Summary (Epoch 3)
Evaluation Loss: 0.253372
Evaluation Precision: 0.704872
Evaluation Recall: 0.650684
Evaluation F1: 0.676695
Evaluation Accuracy: 0.920898
Usage
You can use this model with the Hugging Face transformers library to perform NER on Azerbaijani text. Here’s an example:
Installation
Make sure you have the transformers library installed:
pip install transformers
Inference Example
Load the model and tokenizer, then run the NER pipeline on Azerbaijani text:
python
1from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
23# Load the model and tokenizer4model_name ="IsmatS/mbert-az-ner"5tokenizer = AutoTokenizer.from_pretrained(model_name)6model = AutoModelForTokenClassification.from_pretrained(model_name)78# Set up the NER pipeline9nlp_ner = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")1011# Example sentence12sentence ="Bakı şəhərində Azərbaycan Respublikasının prezidenti İlham Əliyev."13entities = nlp_ner(sentence)1415# Display entities16for entity in entities:17print(f"Entity: {entity['word']}, Label: {entity['entity_group']}, Score: {entity['score']}")