Run this model with HF Jobs
Run pykale/bart-base-ocr on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/pykale/bart-base-ocr. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/pykale/bart-base-ocr on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use pykale/bart-base-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pykale/bart-base-ocr with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("pykale/bart-base-ocr") model = AutoModelForSeq2SeqLM.from_pretrained("pykale/bart-base-ocr", device_map="auto") - Notebooks
- Google Colab
- Kaggle
BART-base-ocr
This model is released as part of the paper Leveraging LLMs for Post-OCR Correction of Historical Newspapers and designed to correct OCR text. BART-base is fine-tuned for post-OCR correction of historical English, using BLN600, a parallel corpus of 19th century newspaper machine/human transcription.
Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
model = AutoModelForSeq2SeqLM.from_pretrained('pykale/bart-base-ocr')
tokenizer = AutoTokenizer.from_pretrained('pykale/bart-base-ocr')
generator = pipeline('text2text-generation', model=model.to('cuda'), tokenizer=tokenizer, device='cuda', max_length=1024)
ocr = "The defendant wits'fined ๏ฟฝ5 and costs."
pred = generator(ocr)[0]['generated_text']
print(pred)
Citation
@inproceedings{thomas-etal-2024-leveraging,
title = "Leveraging {LLM}s for Post-{OCR} Correction of Historical Newspapers",
author = "Thomas, Alan and Gaizauskas, Robert and Lu, Haiping",
editor = "Sprugnoli, Rachele and Passarotti, Marco",
booktitle = "Proceedings of the Third Workshop on Language Technologies for Historical and Ancient Languages (LT4HALA) @ LREC-COLING-2024",
month = "may",
year = "2024",
address = "Torino, Italia",
publisher = "ELRA and ICCL",
url = "https://aclanthology.org/2024.lt4hala-1.14",
pages = "116--121",
}
- Downloads last month
- 35
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support