Instructions to use ebadhussain20/urdu_ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ebadhussain20/urdu_ocr with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ebadhussain20/urdu_ocr", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,31 +13,50 @@ licence: license
|
|
| 13 |
This model is a fine-tuned version of [unsloth/qwen2-vl-7b-instruct-unsloth-bnb-4bit](https://huggingface.co/unsloth/qwen2-vl-7b-instruct-unsloth-bnb-4bit).
|
| 14 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 15 |
|
| 16 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
```python
|
| 19 |
-
from transformers import pipeline
|
| 20 |
|
| 21 |
-
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 22 |
-
generator = pipeline("text-generation", model="None", device="cuda")
|
| 23 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 24 |
-
print(output["generated_text"])
|
| 25 |
```
|
| 26 |
|
| 27 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
| 41 |
|
| 42 |
## Citations
|
| 43 |
|
|
|
|
| 13 |
This model is a fine-tuned version of [unsloth/qwen2-vl-7b-instruct-unsloth-bnb-4bit](https://huggingface.co/unsloth/qwen2-vl-7b-instruct-unsloth-bnb-4bit).
|
| 14 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 15 |
|
| 16 |
+
##A transformer-based OCR model fine-tuned for recognizing Urdu text from images.
|
| 17 |
+
|
| 18 |
+
This repository contains a fine-tuned VisionEncoderDecoderModel built on top of TrOCR for Urdu Optical Character Recognition (OCR). The model is trained to extract Urdu text from scanned documents, printed pages, and image-based text inputs.
|
| 19 |
+
|
| 20 |
+
Open model
|
| 21 |
+
View benchmark notebook
|
| 22 |
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
```
|
| 25 |
|
| 26 |
+
## Highlights
|
| 27 |
+
|
| 28 |
+
Fine-tuned specifically for Urdu script recognition.
|
| 29 |
+
|
| 30 |
+
Works on scanned pages, screenshots, and cropped text regions.
|
| 31 |
+
|
| 32 |
+
Built using Hugging Face Transformers and TrOCR.
|
| 33 |
+
|
| 34 |
+
Easy inference pipeline with minimal code..
|
| 35 |
+
|
| 36 |
+
### Quick Start
|
| 37 |
+
|
| 38 |
+
Install dependencies
|
| 39 |
|
| 40 |
+
Load the model
|
| 41 |
|
| 42 |
+
Run inference
|
| 43 |
|
| 44 |
+
###Training Procedure
|
| 45 |
|
| 46 |
+
This model was fine-tuned using supervised learning on paired image–text data for Urdu OCR.
|
| 47 |
+
###Training details
|
| 48 |
+
###Parameter Value
|
| 49 |
+
Base model microsoft/trocr-base-handwritten
|
| 50 |
+
Task Sequence-to-sequence OCR
|
| 51 |
+
Framework Transformers Trainer API
|
| 52 |
+
Optimization Cross-entropy loss
|
| 53 |
|
| 54 |
+
###Intended Use
|
| 55 |
+
###Suitable for
|
| 56 |
+
Digitizing Urdu books and documents.
|
| 57 |
+
Extracting text from scanned PDFs.
|
| 58 |
+
OCR preprocessing for NLP pipelines.
|
| 59 |
+
Research and educational projects involving Urdu script.
|
| 60 |
|
| 61 |
## Citations
|
| 62 |
|