File size: 6,604 Bytes
cb301d1
67061ca
cb301d1
 
03c9e83
 
 
 
 
 
 
a15b7d9
03c9e83
 
 
 
 
f0c2036
 
 
 
 
 
 
 
 
 
 
 
 
cb301d1
 
 
 
 
 
 
03c9e83
cb301d1
70fdfe0
 
 
 
cb301d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
03c9e83
cb301d1
 
 
 
 
 
 
 
b969b85
cb301d1
 
 
 
03c9e83
 
 
 
 
 
 
 
 
 
32a6080
 
03c9e83
35877ca
6cbc4c0
cb301d1
 
 
 
03c9e83
cb301d1
 
5c07823
cb301d1
93400b2
cb301d1
5c07823
cb301d1
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
base_model: t5-small
license: mit
language: kaz
tags:
  - text2text-generation
  - transliteration
  - kazakh
  - low-resource
  - cultural-nlp
  - t5
pipeline_tag: text2text-generation
widget:
  - text: "Cyrillic2Latin: Мен қазақ тілінде сөйлеймін."
model-index:
- name: DalaT5
  results:
    - task:
        name: Transliteration
        type: text2text-generation
      dataset:
        name: Kazakh Cyrillic–Latin Transliteration Corpus
        type: custom
      metrics:
        - name: Validation Loss
          type: loss
          value: 0.4126
        - name: Training Loss
          type: loss
          value: 0.5390
---
# DalaT5 — T5 Fine-Tuned on Cyrillic-to-Latin Kazakh 🇰🇿

> 'Dala' means 'steppe' in Kazakh - a nod to where the voice of this model might echo.

**DalaT5** is a fine-tuned version of `t5-small`, trained to **translate Kazakh text written in Cyrillic** into **Latin script** using the officially adopted [2021 alphabet reform](https://astanatimes.com/2021/02/kazakhstan-presents-new-latin-alphabet-plans-gradual-transition-through-2031/).

Unlike language models that *generate* creatively, DalaT5 is trained as a **faithful transliterator** - preserving content while transforming form. It is also meant to serve as a **foundational model** to be improved upon as needed.

⚠️ Limitations
- May produce unexpected outputs for very short inputs or mixed-script text
- Still under refinement - accuracy may vary across dialects or uncommon characters

---

## 🧠 Purpose

This model wasn’t built for production-grade translation or for linguistic study alone.

It was born from something else:
- A deep **respect for Kazakh culture**
- A desire to let its **future alphabet speak**
- A belief that **languages deserve continuity** - even through code

> *Though I am not Kazakh by birth, I wanted Kazakh to have a voice among the languages of the future - in its new script, as a symbol of memory and continuity.*

---

## 🌍 Жоба туралы / About the Project

### 🏕 Қазақша

**DalaT5** - T5 моделінің негізінде жасалған тәжірибелік жоба. Ол **қазақ мәтінін кирилл жазуынан** **латын графикасына** аударады.

Бұл жоба:
- Ресми 2021 латын әліпбиіне негізделген  
- Қолдануға, дамытуға және шабыт алуға ашық  
- Шетел азаматының ниетпен жасаған еңбегі

> *Қазақ емеспін, бірақ осы тіл мені сезіндіріп отыр. Бұл модель - құрмет пен махаббаттың нәтижесі.*

---

### 🌐 English

**DalaT5** is a transformer fine-tuned on Kazakh Cyrillic–to–Latin data, designed to support Kazakhstan’s national script reform. The model focuses on script conversion, not translation, making it ideal for educational tools and linguistic preservation.

This project:
- Supports **underrepresented languages** in AI  
- Offers **open access** to the Latinised future of Kazakh  
- Was created by a foreigner - with humility, curiosity, and deep care

---

## 💻 Try it out

Құшақтап тұрған бет арқылы тікелей пайдаланыңыз 🤗 Трансформерлер: / Use directly via Hugging Face 🤗 Transformers:

```python
from transformers import pipeline

pipe = pipeline("text2text-generation", model = "crossroderick/dalat5")

text = "Мен қазақ тілінде сөйлеймін."
input_text = f"Cyrillic2Latin: {text}"
output = pipe(input_text, max_length = 128)[0]["generated_text"]

print(output)
```

## 📊 Data sources

DalaT5 екі өте маңызды деректер жиынын пайдаланады / DalaT5 makes use of two very important datasets:

- The first 1 million records of the Kazakh subset of the CC100 dataset by [Conneau et al.](https://paperswithcode.com/paper/unsupervised-cross-lingual-representation-1)
- The Wikipedia dump of articles in the Kazakh language

Деректер жиынының жалпы өлшемін ескере отырып, олар осы үлгінің репозиторийіне қосылмаған. Дегенмен, DalaT5-ті өзіңіз дәл баптағыңыз келсе, келесі әрекеттерді орындаңыз / Given the total size of the datasets, they haven't been included in this model's repository. However, should you wish to fine-tune DalaT5 yourself, please do the following:

1. `get_data.sh` қабық сценарий файлын «src/data» қалтасында іске қосыңыз / Run the `get_data.sh` shell script file in the "src/data" folder
2. Сол қалтадағы `generate_cyr_lat_pairs.py` файлын іске қосыңыз / Run the `generate_cyr_lat_pairs.py` file in the same folder 
3. Қазақ корпус файлын тазалау үшін `generate_clean_corpus.sh` іске қосыңыз / Run `generate_clean_corpus.sh` to clean the Kazakh corpus file

Егер сіз Windows жүйесінде болсаңыз, `get_data.sh` сценарийі жұмыс істемеуі мүмкін. Дегенмен, файлдағы сілтемелерді орындап, ондағы қадамдарды қолмен орындау арқылы әлі де деректерді алуға болады. Сол сияқты, `generate_clean_corpus.sh` файлында да қате пайда болады, бұл сізге `kazakh_latin_corpus.json` файлындағы бос немесе бос жолдарды сүзу үшін баламалы Windows функциясын табуды талап етеді. / If you're on Windows, the `get_data.sh` script likely won't work. However, you can still get the data by following the links in the file and manually doing the steps in there. Likewise, `generate_clean_corpus.sh` will also error out, requiring you to find an equivalent Windows functionality to filter out blank or empty lines in the `kazakh_latin_corpus.json` file.

---

## 📚 Credits

Егер сіз DalaT5-ті туынды жұмыстарды зерттеуде қолдансаңыз, мыналарды келтіріңіз: / If you use DalaT5 in research of derivative works, feel free to cite:

```
@misc{crossroderick_dalat5_2025,
  author = {Rodrigo Pereira Cruz},
  title = {DalaT5: Cyrillic-to-Latin Kazakh transliterator on fine-tuned T5},
  year = 2025,
  url = {https://huggingface.co/crossroderick/dalat5}
}
```