ainouche-abderahmane commited on
Commit
ddfa4e1
·
verified ·
1 Parent(s): 34b7cba

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +71 -41
README.md CHANGED
@@ -51,8 +51,8 @@ that general-purpose engines drop or normalise away, and dropping them changes t
51
 
52
  ## Results
53
 
54
- **1,000 held-out lines, rendered from text the model never read**, drawn with a fixed seed
55
- from beyond the 80,000-sentence prefix training consumed.
56
 
57
  | | |
58
  |---|---|
@@ -91,53 +91,35 @@ model supplies where the source has none — so a 2.85% character rate still fai
91
  words and 29.8% of lines. `Azul, ansuf yis-m!` comes back as `Azul, Ansuf yi s-m!`: **two
92
  character edits, three word edits of three, one line failed.**
93
 
94
- **Sub-dot accuracy depends on the typeface.** In Times New Roman and Arial the model returns
95
- `Aḍris n uḥric ɣef tɛeṛṛamt d uẓekka.` exactly. In a high-contrast display face with hairline
96
- serifs the same line loses dots `tɛeṛṛamt` becomes `tzeṛṛamt`, `uḥric` becomes `uɣric`. The
97
- 0.8538 above is averaged over eight faces including the hard ones. On a clean 300 DPI scan in
98
- a book face, expect better; on a photocopy of a display-set title page, expect worse.
 
 
 
 
 
 
99
 
100
  **The training log's 2.65% CER is a different statistic and is not comparable.** It is
101
  measured over at most sixteen batches — about 512 lines — of a split held out from the same
102
  prefix the model trained on. It selects checkpoints; the table above is the benchmark.
103
 
104
- ## What it was trained on, and the limit that follows
105
-
106
- Lines are **rendered, not scanned.** There is no page of real Kabyle print with
107
- character-level ground truth to train against, so the corpus is text set in eight to twelve
108
- typefaces and put through a degradation pipeline — skew up to ±2°, Gaussian defocus, sensor
109
- grain, ink bleed and ribbon fade, photocopier exposure jitter, aged-paper tint, spine-gutter
110
- shadow and bleed-through from the reverse side.
111
-
112
- **The Latin text is one source.** Training read the first 80,000 sentences of AƔBALU-Text v1,
113
- and that prefix is **100% `hf.abdelhaqueidali.kab-latn-tfng`, CC-BY-2.0** — a single
114
- sentence-level dataset, not the 42-source corpus. The Tifinagh half is the `agbalu/KabTifinagh`
115
- train split. **The held-out lines above come from the same source**, further down the same
116
- file: they are text the model has not read, in a register it has. Nothing here measures
117
- generalisation to a different kind of Kabyle prose, and a novel's long sentences and a
118
- newspaper's headlines are both outside what was tested.
119
-
120
- 50/50 Latin and Tifinagh, 80,000 rendered lines, 3 epochs.
121
 
122
- ## Known defects
 
 
123
 
124
- **`ţ` (U+0163) is not in the vocabulary, and it is real Kabyle.** `docs/orthography.md`
125
- attests it 21,058 times in this project's own corpus. The 171-symbol table has no slot for
126
- it, so it encodes as `<unk>` and cannot be produced: `Aţan yeţţaḍsa, ţ-ţaqbaylit.` comes back
127
- as `Aṭan yeaḍsa, -aqbaylit.` in every typeface tested. Adding the letter changes the width of
128
- the output projection, so it is a retrain rather than an edit, and until then any page using
129
- that convention is unrecoverable at those positions.
130
 
131
- **Casing and spacing are the dominant error class**, not the diacritics. Word-initial capitals
132
- are inserted and word boundaries are split or merged.
133
-
134
- **Page layout is a projection profile, nothing more.** `recognize_page` finds horizontal ink
135
- bands and crops them. It has no column detection, no reading-order model, no table or figure
136
- handling; a two-column periodical will be read straight across.
137
-
138
- **Nothing here is a decision about a person**, and nothing here has been evaluated on any
139
- language but Kabyle. Tarifit, Tashelhit and Central Atlas Tamazight share part of this
140
- orthography and are not covered.
141
 
142
  ## Usage
143
 
@@ -200,6 +182,54 @@ the ink is broken, which is precisely the failure an OCR system must not have: i
200
  fluent Kabyle that is not what the page says. 171 classes put the logit surface at 0.25 MB and
201
  make the character error rate a count of this table's own symbols.
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  ## Files
204
 
205
  | file | contents |
 
51
 
52
  ## Results
53
 
54
+ **1,000 held-out lines, in text the model never read and typefaces it never saw**, drawn with
55
+ a fixed seed from beyond the 80,000-sentence prefix training consumed.
56
 
57
  | | |
58
  |---|---|
 
91
  words and 29.8% of lines. `Azul, ansuf yis-m!` comes back as `Azul, Ansuf yi s-m!`: **two
92
  character edits, three word edits of three, one line failed.**
93
 
94
+ **Every typeface in the table is one the model has never seen.** Training renders in DejaVu,
95
+ FreeFont, Liberation and Noto; the evaluation renders in Times New Roman, Times, Arial,
96
+ Helvetica, Georgia, Baskerville, Courier New and Didot. The numbers are therefore a
97
+ generalisation result across letterforms, not a memorisation one and they are conservative
98
+ for it.
99
+
100
+ **Sub-dot accuracy depends on which of those eight it is.** In Times New Roman and Arial the
101
+ model returns `Aḍris n uḥric ɣef tɛeṛṛamt d uẓekka.` exactly. In a high-contrast display face
102
+ with hairline serifs the same line loses dots — `tɛeṛṛamt` becomes `tzeṛṛamt`, `uḥric`
103
+ becomes `uɣric`. 0.8538 is the average over all eight. On a clean 300 DPI scan in a book
104
+ face, expect better; on a photocopy of a display-set title page, expect worse.
105
 
106
  **The training log's 2.65% CER is a different statistic and is not comparable.** It is
107
  measured over at most sixteen batches — about 512 lines — of a split held out from the same
108
  prefix the model trained on. It selects checkpoints; the table above is the benchmark.
109
 
110
+ ## Intended use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
+ Turning printed Kabyle into text: scanned novels, grammars, periodicals and archive
113
+ material, in the Latin orthography or in Neo-Tifinagh, from the same model and without
114
+ telling it which it is looking at.
115
 
116
+ **A line or a page, not a word.** Every input is scaled to 52 px of usable height, so a
117
+ single word blown up to that height is nothing the model has seen.
 
 
 
 
118
 
119
+ **Not suitable for**: handwriting, which is absent from the training data entirely;
120
+ multi-column layout, which `transcribe_page` reads straight across; any decision about a
121
+ person; or any language other than Kabyle. Tarifit, Tashelhit and Central Atlas Tamazight
122
+ share part of this orthography and are not evaluated here.
 
 
 
 
 
 
123
 
124
  ## Usage
125
 
 
182
  fluent Kabyle that is not what the page says. 171 classes put the logit surface at 0.25 MB and
183
  make the character error rate a count of this table's own symbols.
184
 
185
+ ## Training data
186
+
187
+ Lines are **rendered, not scanned.** There is no page of real Kabyle print with
188
+ character-level ground truth to train against, so the corpus is text set in the serif and
189
+ sans faces of DejaVu, FreeFont, Liberation and Noto — plus Noto Sans Tifinagh, which no
190
+ distribution font package carries and which ships in the training repository — and put
191
+ through a degradation pipeline: skew up to ±2°, Gaussian defocus, sensor grain, ink bleed
192
+ and ribbon fade, photocopier exposure jitter, aged-paper tint, spine-gutter shadow, and
193
+ bleed-through from the reverse side.
194
+
195
+ **The Latin text is one source.** Training read the first 80,000 sentences of AƔBALU-Text v1,
196
+ and that prefix is **100% `hf.abdelhaqueidali.kab-latn-tfng`, CC-BY-2.0** — a single
197
+ sentence-level dataset, not the 42-source corpus. The Tifinagh half is the
198
+ `agbalu/KabTifinagh` train split. **The held-out lines in the results table come from the
199
+ same source**, further down the same file: they are text the model has not read, in a
200
+ register it has. Nothing here measures generalisation to a different kind of Kabyle prose,
201
+ and a novel's long sentences and a newspaper's headlines are both outside what was tested.
202
+
203
+ ## Training recipe
204
+
205
+ | | |
206
+ |---|---|
207
+ | Corpus | 80,000 rendered lines, 50/50 Latin and Neo-Tifinagh |
208
+ | Split | 95/5, drawn at a fixed seed over the whole set rather than off the end |
209
+ | Epochs | 3 |
210
+ | Batch | 32 lines |
211
+ | Optimiser | AdamW, weight decay 0.01 on non-norm parameters |
212
+ | Schedule | cosine to 5% of peak, 5% warmup, peak 1.5e-4 |
213
+ | Gradient clipping | 1.0, checked before the step rather than after |
214
+ | Selection | best character error rate on the held-out split |
215
+ | Hardware | one A10G |
216
+
217
+ ## Limitations
218
+
219
+ **`ţ` (U+0163) has no slot in the vocabulary, and it is real Kabyle.**
220
+ `docs/orthography.md` attests it 21,058 times in this project's own corpus. It encodes as
221
+ `<unk>` and cannot be produced: `Aţan yeţţaḍsa, ţ-ţaqbaylit.` comes back as
222
+ `Aṭan yeaḍsa, -aqbaylit.` in every typeface tested. Adding the letter changes the width of
223
+ the output projection, so it costs a retrain, and until then any page using that convention
224
+ is unrecoverable at those positions.
225
+
226
+ **Casing and spacing are the dominant error class**, not the diacritics. Word-initial
227
+ capitals are inserted where the source has none, and word boundaries are split or merged.
228
+
229
+ **Page layout is a projection profile, nothing more.** `transcribe_page` finds horizontal
230
+ ink bands and crops them. There is no column detection, no reading-order model and no table
231
+ or figure handling, so a two-column periodical is read straight across.
232
+
233
  ## Files
234
 
235
  | file | contents |