OCR tamazight kabyle
# Tesseract OCR for Kabyle / Amazigh (Latin script)
This repository contains the `kab.traineddata` language model for Tesseract OCR (v4.0.0 and v5+), dedicated to the **Kabyle language (Taqbaylit)** and standard **Amazigh** written in the Latin alphabet.
This model is a community contribution developed as part of the **Dawaliw-ⵣ-OCR** project.
## 🌟 Model Overview
- **Language Code:** `kab` (ISO 639-3)
- **Engine:** LSTM only
- **Base model:** Fine-tuned from `fra` (French)
- **Supported script:** Latin (with extended Amazigh characters)
- **Current Version:** v6.0 (August 2026)
## 🔤 Supported Characters
The model recognizes the 33 standard Amazigh letters, including the specific diacritics used in Kabyle linguistics, as well as their uppercase equivalents:
* **Base Latin:** a, b, c, d, e, f, g, h, i, k, l, m, n, q, r, s, t, u, w, x, y, z
* **Extended Amazigh (Special Characters):**
* `ɣ` (Gamma)
* `ḥ` (h with dot below)
* `ɛ` (Open E)
* `ḍ`, `ẓ`, `ṭ`, `ṣ`, `ṛ` (Emphatic consonants with dot below)
* `č`, `ǧ` (Caron)
* `ţ` (t with cedilla - specific to Kabyle)
* `ʷ`, `ᵒ` (Modifier letters for labiovelarization)
*(Note: The model correctly normalizes the Greek epsilon `ε` to the Latin open E `ɛ` to respect strict Unicode standards for Amazigh data).*
## 📊 Performance (v6)
The model was trained on both synthetic data (78k unique Kabyle words) and fine-tuned on real historical scans (e.g., *Dictionnaire Kabyle-Français J.M. Dallet*).
- **BCER (Character Error Rate):** 1.50%
- **BWER (Word Error Rate):** 3.42%
- On recent, clean, single-column documents, accuracy on special Amazigh characters reaches **95% - 100%**.
## 📥 Installation
1. Download the `kab.traineddata` file.
2. Place it in your Tesseract `tessdata` directory.
- **Linux:** `/usr/share/tesseract-ocr/4.00/tessdata/` or `/usr/share/tesseract-ocr/5/tessdata/`
- **Windows:** `C:\Program Files\Tesseract-OCR\tessdata\`
- **macOS (Homebrew):** `/opt/homebrew/share/tessdata/` or `/usr/local/share/tessdat …