How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("feature-extraction", model="g3ida/ArabicWordsEmbedding")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModel

processor = AutoProcessor.from_pretrained("g3ida/ArabicWordsEmbedding")
model = AutoModel.from_pretrained("g3ida/ArabicWordsEmbedding", device_map="auto")
Quick Links

ArabicWordsEmbedding

Training

  • Real data: about 400k word crops from 3,000 scanned pages of classical Arabic printed books (seemorg/books-ocr, human-reviewed transcriptions). Word boxes come from Tesseract and are aligned to the transcription.
  • Synthetic data: generated on the fly in about 50 fonts. Each word is rendered with full, partial or no tashkeel, attached punctuation and neighbouring words, then cropped like a word detector would and degraded like a scan (low resolution, blur, JPEG, binarisation, noise, rotation).
  • Objective: contrastive (InfoNCE). Every batch contains lookalike words (same letters without dots), plus targeted pairs where tashkeel or punctuation imitates a dot.
  • Method: LoRA on the vision tower and the transformer, merged into this checkpoint.

Limitations

  • Trained and tested on printed Arabic book pages. Handwriting, scene text and decorative fonts were not evaluated.
  • Real-data boxes came from Tesseract. A detector that cuts boxes very differently (much tighter, or several words per box) may need a quick check.
  • Short words that differ by one prefix letter (ู„ / ุงู„ / ูˆ) cause most of the remaining real errors.
  • Matching inside one page is the intended use. Open-vocabulary recognition is weaker: 93.6% top-1 among 31.7k words.

License

Apache 2.0, the same as the base model google/embeddinggemma-2. Training pages come from seemorg/books-ocr (MIT).

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

Model tree for g3ida/ArabicWordsEmbedding

Finetuned
(151)
this model

Dataset used to train g3ida/ArabicWordsEmbedding