distilbert-base-turkish-ner-assistant
This model is a fine-tuned, high-performance DistilBERT model optimized for Named Entity Recognition (NER) / Token Classification in Turkish text.
Unlike standard NER models that only detect Persons, Organizations, and Locations (from PAN-X), this model is supercharged with a custom synthetic dataset to detect Smart Assistant Entities such as Lessons, Academic Activities, Dates, Times, and Schedules.
Bu model, Türkçe metinler üzerinde İsim Varlığı Tanıma (NER) / Token Sınıflandırma işlemleri için ince ayar (fine-tune) yapılmış, yüksek performanslı bir DistilBERT modelidir. Standart NER modellerinin tespit ettiği Kişi, Kurum ve Konum etiketlerine ek olarak; akıllı asistan sistemleri için kritik olan Ders, Akademik Aktivite, Tarih, Saat ve Program etiketlerini de başarıyla tanıyabilmektedir.
Supported Entities / Desteklenen Etiketler (17 Classes)
The model evaluates tokens using the following comprehensive schema: Model, metinleri şu 17 sınıflı Süper Matris şemasına göre etiketler:
O: Outside (Etiketsiz Kelimeler)B-PER/I-PER: Person (Kişi)B-ORG/I-ORG: Organization (Kurum/Kuruluş)B-LOC/I-LOC: Location (Konum/Yer)B-LESSON/I-LESSON: Academic Lessons (Matematik, Fizik vb.)B-ACT/I-ACT: Academic Activities / Tasks (Vize, Ödev, Proje, Laboratuvar vb.)B-DATE/I-DATE: Dates (Bugün, Yarın, Pazartesi, 5 Ekim vb.)B-TIME/I-TIME: Times (14:00, iki buçukta, sabah, akşam vb.)B-PROG/I-PROG: Schedule / Calendar Terms (Sınav takvimi, haftalık plan vb.)
How to Get Started with the Model / Nasıl Kullanılır?
To get correct entity names instead of LABEL_x strings, you must load the model configuration with its label mappings. You can easily copy and run the snippet below:
LABEL_x çıktısı yerine doğrudan gerçek etiket isimlerini (B-LESSON, B-DATE vb.) görebilmek için pipeline oluşturulurken haritalama ayarlarının yapılması gerekir. Aşağıdaki hazır kodu doğrudan kullanabilirsiniz:
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
model_name = "omercakar123/distilbert-base-turkish-ner-assistant"
# 17 Custom Labels Mapping
label_list = [
"O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC",
"B-LESSON", "I-LESSON", "B-DATE", "I-DATE", "B-TIME", "I-TIME",
"B-PROG", "I-PROG", "B-ACT", "I-ACT"
]
id2label = {i: label for i, label in enumerate(label_list)}
label2id = {label: i for i, label in enumerate(label_list)}
# Load model & tokenizer with correct configurations
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(
model_name,
id2label=id2label,
label2id=label2id
)
# Initialize pipeline with simple aggregation strategy
ner_pipeline = pipeline(
"token-classification",
model=model,
tokenizer=tokenizer,
aggregation_strategy="simple"
)
# Test Sentence / Test Cümlesi
sentence = "Bugün saat 14:00'te Matematik vizesi planına kesinlikle göz atmalıyım."
predictions = ner_pipeline(sentence)
for p in predictions:
print(f"Word: {p['word']} | Entity: {p['entity_group']} | Score: {p['score']:.4f}")
Training Details / Eğitim Detayları
Training Data / Eğitim Verisi
PAN-X (Turkish split): 15,000 sentences for base General NER capabilities (PER, ORG, LOC).
Custom Synthetic Assistant Dataset: 10,000 sentences specifically engineered to handle complex Turkish syntax, vowel harmony rules, and time/lesson annotations for dynamic assistant contexts.
Training Hyperparameters
Base Architecture: dbmdz/distilbert-base-turkish-cased
Learning Rate: 2e-5
Batch Size: 16
Epochs: 3
Loss Function: Weighted Cross-Entropy Loss to counter label imbalance.
Model Card Contact / İletişim
Developed as a core specialized extraction asset for personal assistant ecosystems. For issues, optimization ideas, or contributions, contact via Hugging Face.
- Downloads last month
- 22