Passenger list typed reader

Reads one typed name from a strip cut out of a US ship passenger list. Fine-tuned from microsoft/trocr-base-printed on about 3,700 name strips from New York arrival lists, 1897 to 1957 (National Archives microfilm T715, scanned on archive.org).

Part of passenger-list-reader, which finds the name column, cuts one strip per name, sorts typed from handwritten, and sends typed strips here. For handwritten strips use passenger-list-handwriting-reader.

Use

from PIL import Image
from transformers import TrOCRProcessor, VisionEncoderDecoderModel

proc = TrOCRProcessor.from_pretrained("horatio12/passenger-list-typed-reader")
model = VisionEncoderDecoderModel.from_pretrained("horatio12/passenger-list-typed-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 9 typed pages from reels nothing was trained on, counting only names where two independent reads agree on the truth: 258 of 315 words right (81.9%), 101 full names right, 5.2% of letters wrong. The base model on the same pages, with the older strip cutter, got 70 words and 5 full names right.

Training labels

Each strip was read twice by Claude, and only names where both reads agreed were kept. They were not checked by a person.

Limits

Tuned for short name strips from these lists, not for general printed text. Untested on other ports, though US ports used the same federal forms from 1907 on. Strips that clip a first letter or hold two rows read badly.

License

MIT, following the TrOCR code. The base model's card states no license.

Downloads last month
36
Safetensors
Model size
0.3B 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-typed-reader

Finetuned
(28)
this model