Feature Extraction
Transformers
Safetensors
Arabic
embedding_gemma2
arabic
ocr
document-ai
word-matching
multimodal-embedding
embeddinggemma
Instructions to use g3ida/ArabicWordsEmbedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use g3ida/ArabicWordsEmbedding with Transformers:
# 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") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from g3ida/ArabicWordsEmbedding: direct link, hf CLI and curl.
- Browser
- Download file 2.02 kB
-
https://huggingface.co/g3ida/ArabicWordsEmbedding/resolve/main/README.md
- Command line
-
hf download hf://g3ida/ArabicWordsEmbedding/README.md
-
curl -L -o README.md https://huggingface.co/g3ida/ArabicWordsEmbedding/resolve/main/README.md
2.02 kB
metadata
license: apache-2.0
language:
- ar
base_model: google/embeddinggemma-2
library_name: transformers
pipeline_tag: feature-extraction
tags:
- arabic
- ocr
- document-ai
- word-matching
- multimodal-embedding
- embeddinggemma
datasets:
- seemorg/books-ocr
ArabicWordsEmbedding
- Fine-tuned from google/embeddinggemma-2 (440M parameters with the audio encoder removed).
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).