Topaz-61M, fine-tuned (Gregg shorthand reader)
A fine-tuned copy of Topaz-61M, the model that reads Gregg Anniversary shorthand line images into Grascii strokes. I fine-tuned it as part of gregg-shorthand-ocr to narrow the gap between printed textbook Gregg and real handwriting.
Results
Word error rate after the trained decoder (lower is better):
| Test set | Original Topaz | This model |
|---|---|---|
| Functional Method 2, printed, held out | 23.4% | 23.3% |
| Functional Method 2, stroke error | 10.2% | 10.0% |
| Handwritten Genesis, one writer (119 verses) | 44.8% | 41.3% |
| A phone photo of a handwritten letter (143 words) | 65.0% | 55.9% |
| 1929 Manual, stroke error (dev) | 2.92% | 3.08% |
So it's slightly better on handwriting and about the same on print. I also tried mixing in synthetic handwriting (random writers, grid distortion, sigma-lognormal and second-order pen models). None of those beat this plain fine-tune, so this is the one I'm sharing.
Use
This folder holds weights and config only. The inference code comes with the original Topaz:
hf download amongglue/topaz-gregg-shorthand-61m --local-dir topaz-61m # code + original weights
hf download preetham9070/topaz-gregg-61m-finetuned --local-dir topaz-ft
pip install -r topaz-61m/requirements.txt
import sys; sys.path.insert(0, "topaz-61m")
from topaz import Topaz
topaz = Topaz("topaz-ft") # this model
t = topaz.transcribe("page.png")
print(t.grascii)
Training
- Starts from Topaz-61M's released weights (step 92,000).
- 1,500 steps, batch 12, learning rate 3e-5 with 100 warm-up steps, mixed precision. The last step is kept, with no selection on any test set.
- 31,979 line crops from the Topaz book data. Functional Method 2 (test) and the 1929 Manual (dev) are held out.
- Augmentation: stretch, slant, stroke width, blur, contrast and noise. Batch-norm statistics frozen.
finetune.jsonhas the exact arguments and the dev log.
Limitations
- Still trained on printed textbook plates only. Handwriting remains far harder than print, and Gregg's size-based distinctions (N/M, T/D, A/E circles) break when a writer's proportions differ.
- The line finder expects fairly straight lines. Curved notebook pages often split badly.
- Anniversary (1929) Gregg only.
License
MIT, as the original. Topaz-61M is by the Topaz authors (see LICENSE). Fine-tuning by
PreethamReddy333.