🚀 トロクル中世ベースモデル
このモデルは、CATMuSデータセットの中世スクリプト用のTrOCRモデルです。元となったベースモデルはmicrosoft/trocr-base-handwrittenです。このモデルにより、中世の手書き文字を画像からテキストに変換することが可能です。

🚀 クイックスタート
このモデルは、中世の手書き文字を画像からテキストに変換するために使用できます。以下の使用例を参考に、モデルを使ってみてください。
✨ 主な機能
📦 インストール
このモデルを使用するには、transformers
ライブラリが必要です。以下のコマンドでインストールできます。
pip install transformers
💻 使用例
基本的な使用法
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
import requests
url = 'https://huggingface.co/medieval-data/trocr-medieval-print/resolve/main/images/print-1.png'
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
processor = TrOCRProcessor.from_pretrained('medieval-data/trocr-medieval-base')
model = VisionEncoderDecoderModel.from_pretrained('medieval-data/trocr-medieval-base')
pixel_values = processor(images=image, return_tensors="pt").pixel_values
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
📚 ドキュメント
モデル情報
属性 |
详情 |
モデルタイプ |
TrOCRモデル |
訓練データ |
CATMuS |
評価指標
このモデルのCER(Character Error Rate)は0.035です。
注意事項
- このモデルは正式にテストされていません。予備的な検査では、さらなるファインチューニングが必要であることが示されています。
- ファインチューニングは、このリポジトリにある
finetune.py
を使用して行われました。
📄 ライセンス
このモデルはMITライセンスの下で提供されています。
BibTeX entry and citation info
TrOCR Paper
@misc{li2021trocr,
title={TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models},
author={Minghao Li and Tengchao Lv and Lei Cui and Yijuan Lu and Dinei Florencio and Cha Zhang and Zhoujun Li and Furu Wei},
year={2021},
eprint={2109.10282},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
CATMuS Paper
@unpublished{clerice:hal-04453952,
TITLE = {{CATMuS Medieval: A multilingual large-scale cross-century dataset in Latin script for handwritten text recognition and beyond}},
AUTHOR = {Cl{\'e}rice, Thibault and Pinche, Ariane and Vlachou-Efstathiou, Malamatenia and Chagu{\'e}, Alix and Camps, Jean-Baptiste and Gille-Levenson, Matthias and Brisville-Fertin, Olivier and Fischer, Franz and Gervers, Michaels and Boutreux, Agn{\`e}s and Manton, Avery and Gabay, Simon and O'Connor, Patricia and Haverals, Wouter and Kestemont, Mike and Vandyck, Caroline and Kiessling, Benjamin},
URL = {https://inria.hal.science/hal-04453952},
NOTE = {working paper or preprint},
YEAR = {2024},
MONTH = Feb,
KEYWORDS = {Historical sources ; medieval manuscripts ; Latin scripts ; benchmarking dataset ; multilingual ; handwritten text recognition},
PDF = {https://inria.hal.science/hal-04453952/file/ICDAR24___CATMUS_Medieval-1.pdf},
HAL_ID = {hal-04453952},
HAL_VERSION = {v1},
}