Passenger list handwriting reader

Reads one handwritten name from a strip cut out of a US ship passenger list. Fine-tuned from the National Archives of Finland's multicentury-htr-model on name strips from New York arrival lists, 1897 to 1957 (National Archives microfilm T715, scanned on archive.org). Many names are Eastern and Southern European, as written by American clerks and ship officers.

Part of passenger-list-reader. Strips were cut with kraken's line finder, so it reads those best. For typed strips use passenger-list-typed-reader.

Use

from PIL import Image
from transformers import TrOCRProcessor, VisionEncoderDecoderModel

proc = TrOCRProcessor.from_pretrained("horatio12/passenger-list-handwriting-reader")
model = VisionEncoderDecoderModel.from_pretrained("horatio12/passenger-list-handwriting-reader").eval()
pix = proc(images=Image.open("strip.png").convert("RGB"), return_tensors="pt").pixel_values
ids = model.generate(pix, max_new_tokens=48, interpolate_pos_encoding=pix.shape[-1] != pix.shape[-2])
print(proc.batch_decode(ids, skip_special_tokens=True)[0])

Results

On 23 handwritten pages from reels nothing was trained on, counting only names where two independent reads agree on the truth: 559 of 744 words right (75.1%), 178 full names right, 7.5% of letters wrong.

Training labels

Each strip was read twice by Claude (some also by Gemini), and only names where the reads agreed were kept. They were not checked by a person, so hard handwriting is underrepresented.

Limits

Tuned for short name strips, not for running handwriting. Untested on other ports. Hard or faded hands are much less accurate than the average above.

License

Apache 2.0, the same as the base model.

Downloads last month
38
Safetensors
Model size
0.6B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for horatio12/passenger-list-handwriting-reader