Views
No views yet
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.)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:1from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
2
3model_name = "omercakar123/distilbert-base-turkish-ner-assistant"
4
5# 17 Custom Labels Mapping
6label_list = [
7 "O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC",
8 "B-LESSON", "I-LESSON", "B-DATE", "I-DATE", "B-TIME", "I-TIME",
9 "B-PROG", "I-PROG", "B-ACT", "I-ACT"
10]
11id2label = {i: label for i, label in enumerate(label_list)}
12label2id = {label: i for i, label in enumerate(label_list)}
13
14# Load model & tokenizer with correct configurations
15tokenizer = AutoTokenizer.from_pretrained(model_name)
16model = AutoModelForTokenClassification.from_pretrained(
17 model_name,
18 id2label=id2label,
19 label2id=label2id
20)
21
22# Initialize pipeline with simple aggregation strategy
23ner_pipeline = pipeline(
24 "token-classification",
25 model=model,
26 tokenizer=tokenizer,
27 aggregation_strategy="simple"
28)
29
30# Test Sentence / Test Cümlesi
31sentence = "Bugün saat 14:00'te Matematik vizesi planına kesinlikle göz atmalıyım."
32predictions = ner_pipeline(sentence)
33
34for p in predictions:
35 print(f"Word: {p['word']} | Entity: {p['entity_group']} | Score: {p['score']:.4f}")
36
37Training Details / Eğitim Detayları
38Training Data / Eğitim Verisi
39PAN-X (Turkish split): 15,000 sentences for base General NER capabilities (PER, ORG, LOC).
40
41Custom Synthetic Assistant Dataset: 10,000 sentences specifically engineered to handle complex Turkish syntax, vowel harmony rules, and time/lesson annotations for dynamic assistant contexts.
42
43Training Hyperparameters
44Base Architecture: dbmdz/distilbert-base-turkish-cased
45
46Learning Rate: 2e-5
47
48Batch Size: 16
49
50Epochs: 3
51
52Loss Function: Weighted Cross-Entropy Loss to counter label imbalance.
53
54Model Card Contact / İletişim
55Developed as a core specialized extraction asset for personal assistant ecosystems. For issues, optimization ideas, or contributions, contact via Hugging Face.