Skip to content
ModelListedExternal
Download

Tzefa Word OCR TrOCR

Fine-tuned TrOCR model for recognizing individual handwritten Tzefa keywords.

KindOtherVersionRevision 4432d4eCgrade

Model source

Kind
Other
File size
235 MB
Version
vRevision 4432d4e
Updated
Sep 18, 2026
Downloads
12
Source
Hugging Face

Source description

Tzefa Word OCR Model (Fine-tuned TrOCR)

Fine-tuned TrOCR model for recognizing individual handwritten Tzefa keywords.

Architecture

  • Base model: microsoft/trocr-small-stage1
  • Fine-tuned on: Handwritten Tzefa keywords (uppercase Hebrew programming commands, number words, variable names)
  • Framework: HuggingFace Transformers (VisionEncoderDecoderModel)

Vocabulary

Tzefa keywords include:

  • Commands: MAKEINTEGER, MAKESTR, MAKELIST, MAKEBOOL, PRINTINTEGER, PRINTSTR, ADD, SUBTRACT, MULTIPLY, DIVIDE, WHILETRUE, IFTRUE, etc.
  • Number words: ZERO through ONEHUNDRED
  • User-defined variable names

Usage

from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image

# use_fast=False is required to prevent tokenizer conversion crash
processor = TrOCRProcessor.from_pretrained("microsoft/trocr-small-stage1", use_fast=False)
model = VisionEncoderDecoderModel.from_pretrained("WARAJA/Tzefa-Word-OCR-TrOCR")

image = Image.open("word_crop.png").convert("RGB")
pixel_values = processor(image, return_tensors="pt").pixel_values

generated_ids = model.generate(pixel_values)
text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(text)

Related

Sources

1 source
Hugging FacePrimaryVersion 4432d4ed7139bee3e1d26ca8c0b57107f949233f
huggingface.co/WARAJA/Tzefa-Word-OCR-TrOCR/tree/4432d4ed7139bee3e1d26ca8c0b57107f949233f

Verified Sep 3

Model artifacts

1 artifact

model.safetensors

safetensors · 235 MB · SHA-256 e94e83c4e17b…b9fa · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: cc-by-nc-3.0 pipeline_tag: image-to-text tags: - vision - ocr - trocr - transformers - handwriting-recognition - document-processing --- # Tzefa Word OCR Model (Fine-tuned TrOCR) Fine-tuned TrOCR model for recognizing individual handwritten Tzefa keywords. ## Architecture - **Base model:** `microsoft/trocr-small-stage1` - **Fine-tuned on:** Handwritten Tzefa keywords (uppercase Hebrew programming commands, number words, variable names) - **Framework:** HuggingFace Transformers (`VisionEncoderDecoderModel`) ## Vocabulary Tzefa keywords include: - **Commands:** MAKEINTEGER, MAKESTR, MAKELIST, MAKEBOOL, PRINTINTEGER, PRINTSTR, ADD, SUBTRACT, MULTIPLY, DIVIDE, WHILETRUE, IFTRUE, etc. - **Number words:** ZERO through ONEHUNDRED - **User-defined variable names** ## Usage ```python from transformers import TrOCRProcessor, VisionEncoderDecoderModel from PIL import Image # use_fast=False is required to prevent tokenizer conversion crash processor = TrOCRProcessor.from_pretrained("microsoft/trocr-small-stage1", use_fast=False) model = VisionEncoderDecoderModel.from_pretrained("WARAJA/Tzefa-Word-OCR-TrOCR") image = Image.open("word_crop.png").convert("RGB") pixel_values = processor(image, return_tensors="pt").pixel_values generated_ids = model.generate(pixel_values) text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0] print(text) ``` ## Related - [Full Tzefa Pipeline](https://huggingface.co/spaces/WARAJA/Tzefa) - [OCR Demo](https://huggingface.co/spaces/WARAJA/Tzefa-OCR) - [Word OCR Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Word-OCR-Dataset)

Source context: 12 downloads · 1 likes · Pipeline image-to-text · Library transformers · Repo WARAJA/Tzefa-Word-OCR-TrOCR