boffire commited on
Commit
5f98ea0
·
verified ·
1 Parent(s): 673d684

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +168 -0
README.md CHANGED
@@ -35,4 +35,172 @@ dataset_info:
35
  num_examples: 756774
36
  download_size: 34467223
37
  dataset_size: 116790842
 
 
38
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  num_examples: 756774
36
  download_size: 34467223
37
  dataset_size: 116790842
38
+ language:
39
+ - kab
40
  ---
41
+
42
+ # tatoeba-kabyle-mono-cleaned
43
+
44
+ [![Kabyle](https://img.shields.io/badge/lang-kab-blue)](https://en.wikipedia.org/wiki/Kabyle_language)
45
+ [![License](https://img.shields.io/badge/license-CC0--1.0-green)](https://creativecommons.org/publicdomain/zero/1.0/)
46
+ [![Dataset](https://img.shields.io/badge/dataset-HuggingFace-yellow)](https://huggingface.co/datasets/boffire/tatoeba-kabyle-mono-cleaned)
47
+
48
+ Cleaned and quality-assessed monolingual Kabyle corpus extracted from Tatoeba.
49
+
50
+ ---
51
+
52
+ ## Summary
53
+
54
+ This dataset contains sentences from Tatoeba tagged as Kabyle (`lang == "kab"`), processed through a multi-layer linguistic filtering pipeline combining **orthographic normalization**, **language identification** (GlotLID v3 + DistilBERT Kabyle/Tachelhit classifier), **code-switching detection** (MaskLID), and **lexical validation** (Kabyle Hunspell dictionary). Only the subset qualified as **pure** is published here.
55
+
56
+ **Language**: Kabyle (kab) -- standardized Latin script (INALCO 1996 / KIM).
57
+ **Source**: [Tatoeba sentences.csv](https://downloads.tatoeba.org/exports/sentences.csv)
58
+ **License**: CC0 1.0 Universal (Tatoeba)
59
+ **Format**: HuggingFace `datasets` (Arrow)
60
+ **Author**: [boffire](https://huggingface.co/boffire)
61
+
62
+ ---
63
+
64
+ ## Cleaning Pipeline
65
+
66
+ ### 1. Orthographic Normalization
67
+ - Correction of **character false friends** (Greek, Cyrillic, Turkish, etc.): `ε → ɛ`, `γ → ɣ`, `Γ → Ɣ`, `Σ → Ɛ`, etc.
68
+ - Removal of forbidden characters and normalization of French diacritics.
69
+ - Unicode NFC normalization and whitespace cleanup.
70
+
71
+ ### 2. Berber Validation (DistilBERT)
72
+ - Model: [`boffire/distilbert-kabyle-tachelhit-classifier-v2`](https://huggingface.co/boffire/distilbert-kabyle-tachelhit-classifier-v2)
73
+ - Adaptive thresholds based on sentence length.
74
+ - Classification: `kab` (Kabyle) vs `tach` (Tachelhit).
75
+ - Scope: first 10,000 sentences analyzed; remainder flagged as `SKIPPED`.
76
+
77
+ ### 3. Language Identification (GlotLID v3)
78
+ - Model: `cis-lmu/glotlid`
79
+ - Confidence threshold: **>= 0.95** for the published subset.
80
+
81
+ ### 4. Code-Switching Detection (MaskLID)
82
+ - Token-level analysis combining GlotLID, Kabyle Hunspell (Belkacem77), and an auxiliary vocabulary.
83
+ - Detection of isolated borrowings and IOB2 annotation.
84
+ - CS threshold: > 15% non-Kabyle tokens.
85
+
86
+ ### 5. "Pure" Filter
87
+ The published subset retains only sentences that simultaneously satisfy:
88
+ - `is_cs == False` (no code-switching)
89
+ - `len(contaminants) == 0` (no false friends or forbidden characters)
90
+ - `is_mismatch == False` (no GlotLID=kab / DistilBERT=tach divergence)
91
+ - `berber_status` in `{"HIGH_CONF", "SKIPPED"}`
92
+ - `glot_conf >= 0.95`
93
+
94
+ ---
95
+
96
+ ## Statistics
97
+
98
+ | Metric | Value |
99
+ |---|---|
100
+ | Source sentences (Tatoeba `lang=kab`) | 789,712 |
101
+ | Retained sentences (**pure** subset) | **756,774** |
102
+ | Conservation rate | **95.8%** |
103
+ | Hunspell coverage (token-level) | **85.1%** (3,173,402 / 3,730,724 tokens) |
104
+ | Code-switching detection rate | **0.24%** (1,915 phrases) |
105
+ | Orthographic contamination rate | **3.66%** (28,887 phrases) |
106
+ | Contaminant types | `faux_ami`: 31,805 / `non_canonique`: 10,092 / `forbidden`: 617 |
107
+ | GlotLID confidence >= 0.95 | **99.7%** (787,561 phrases) |
108
+ | DistilBERT HIGH_CONF (analyzed) | 9,679 / 10,000 |
109
+ | DistilBERT mismatch kab->tach | 67 (0.67% of analyzed) |
110
+
111
+ ---
112
+
113
+ ## Column Structure
114
+
115
+ | Column | Type | Description |
116
+ |---|---|---|
117
+ | `id` | `string` | Original Tatoeba identifier |
118
+ | `text` | `string` | **Normalized** Kabyle text (use for training) |
119
+ | `raw_text` | `string` | Original raw text (before normalization) |
120
+ | `glot_lang` | `string` | Language predicted by GlotLID v3 |
121
+ | `glot_conf` | `float` | GlotLID confidence score |
122
+ | `berber_label` | `string` | DistilBERT label (`kab` / `tach`) |
123
+ | `berber_score` | `float` | DistilBERT confidence score |
124
+ | `berber_status` | `string` | `HIGH_CONF` / `LOW_CONF` / `REJECT` / `NON_BERBER` / `SKIPPED` |
125
+ | `dominant_lang` | `string` | Dominant language detected by MaskLID |
126
+ | `dominant_ratio` | `float` | Ratio of tokens in the dominant language |
127
+ | `lang_distribution` | `string` | JSON distribution of detected languages (token-level) |
128
+
129
+ ---
130
+
131
+ ## Quick Usage
132
+
133
+ ```python
134
+ from datasets import load_dataset
135
+
136
+ ds = load_dataset("boffire/tatoeba-kabyle-mono-cleaned", split="train")
137
+
138
+ # Example
139
+ print(ds[0]["text"])
140
+ # -> "Tecfiḍ fell-i ?"
141
+
142
+ # Iteration
143
+ for example in ds:
144
+ print(example["text"])
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Recommended Use Cases
150
+
151
+ - **Continued pre-training** of language models (LLM, mT5, etc.)
152
+ - **Fine-tuning** of Kabyle Sentence Transformers
153
+ - **Tokenizer training** for Kabyle-specialized SentencePiece / BPE
154
+ - **Perplexity benchmark** for evaluating the quality of new corpora
155
+ - **Semantic search** (FAISS indexing) and RAG
156
+
157
+ ---
158
+
159
+ ## Known Limitations
160
+
161
+ 1. **Isolated sentence corpus**: Tatoeba provides short utterances without discursive context. For LLM pre-training, this corpus should be complemented with longer documents (Wikipedia, forums, etc.).
162
+ 2. **Technical borrowings**: Integrated technical terms in Kabyle (e.g., *aselkim*, *asiggez*) are retained as they belong to the contemporary lexicon. They do not constitute code-switching.
163
+ 3. **DistilBERT limited scope**: Only the first 10,000 sentences were validated by DistilBERT; the remainder of the corpus is filtered by GlotLID + MaskLID only.
164
+ 4. **Standardized orthography**: Normalization applies the INALCO 1996 / KIM inventory. Non-standard orthographic variants are corrected or discarded.
165
+
166
+ ---
167
+
168
+ ## Related Resources
169
+
170
+ | Resource | Link |
171
+ |---|---|
172
+ | Full pipeline (script) | *to be published* |
173
+ | Raw Tatoeba dataset | [tatoeba.org](https://tatoeba.org) |
174
+ | Berber classifier | [`distilbert-kabyle-tachelhit-classifier-v2`](https://huggingface.co/boffire/distilbert-kabyle-tachelhit-classifier-v2) |
175
+ | Kabyle T5 tokenizer | [`kabyle-tokenizer-T5`](https://huggingface.co/boffire/kabyle-tokenizer-T5) |
176
+ | Sentence Transformer | [`kabyle-sentence-transformer-mpnet`](https://huggingface.co/boffire/kabyle-sentence-transformer-mpnet) |
177
+ | Hunspell dictionary | [Imseɣti n tira n teqbaylit](https://github.com/Belkacem77/imseti_n_tira_n_teqbaylit) (Belkacem77, MIT) |
178
+ | Kabyle language specifications | [kabyle-specs.github.io](https://kabyle-specs.github.io) |
179
+
180
+ ---
181
+
182
+ ## Citation
183
+
184
+ If you use this dataset, please cite:
185
+
186
+ ```bibtex
187
+ @dataset{tatoeba_kabyle_mono_cleaned_2026,
188
+ author = {Mokraoui, Athmane},
189
+ title = {Tatoeba Kabyle Mono Cleaned},
190
+ year = {2026},
191
+ publisher = {HuggingFace},
192
+ url = {https://huggingface.co/datasets/boffire/tatoeba-kabyle-mono-cleaned}
193
+ }
194
+ ```
195
+
196
+ ---
197
+
198
+ ## Changelog
199
+
200
+ | Version | Date | Change |
201
+ |---|---|---|
202
+ | `1.0.0` | 2026-08-01 | Initial release (756,774 pure sentences) |
203
+
204
+ ---
205
+
206
+ *Dataset maintained by [boffire](https://huggingface.co/boffire). For questions or contributions, please open an issue on the repository.*