Instructions to use hananelhosary8/Nile-Chat-4B-Transit-Extractor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hananelhosary8/Nile-Chat-4B-Transit-Extractor with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hananelhosary8/Nile-Chat-4B-Transit-Extractor", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Nile-Chat-4B-Transit-Extractor
This model is a fine-tuned version of Nile-Chat-4B designed to extract transit-related entities (Start Points and Destinations) from Egyptian Arabic dialect. It is a core component of the NaviTour project, an AI assistant for Cairo transportation.
Model Description
- Developed by: Hanan Elsaid Elhosary
- Model type: Causal Language Model (Fine-tuned for NER tasks)
- Language(s): Arabic (Egyptian Dialect)
- Finetuned from model: MBZUAI-Paris/Nile-Chat-4B
Intended Uses
This model is specifically optimized to take an Egyptian dialect query about directions and output a structured JSON containing:
start_point: The location the user is coming from.end_point: The intended destination.
Example:
Input: "عايز أروح رمسيس من الدقي"
Output: {"start_point": "الدقي", "end_point": "رمسيس"}
Training Details
- Technique: LoRA (Low-Rank Adaptation)
- Quantization: 4-bit (BitsAndBytes)
- Epochs: 1.038 (Stopped early to prevent overfitting)
- Hardware: NVIDIA T4 GPU
Training Data
The model was trained on a custom dataset of 3,762 curated Egyptian Arabic transit queries.
Data Format
Each sample follows the Alpaca instruction format, specifically designed for entity extraction tasks. The dataset includes:
- Instruction-based prompts: Direct and indirect navigation requests.
- Natural Dialect: Real-world Egyptian slang and idioms (e.g., "يا معلم", "أركب إيه").
- Structured Outputs: Clean JSON mapping of transit entities.
Examples:
| Instruction | Output (JSON) |
|---|---|
| "لو عايز أروح جمعية الصناعات الصغيرة في 6 أكتوبر أركب إيه؟" | {"start_point": "", "end_point": "جمعية الصناعات الصغيرة (6 أكتوبر)"} |
| "يا معلم أروح من كوبري قصر النيل لمستشفى قصر العيني إزاي؟" | {"start_point": "كوبري قصر النيل", "end_point": "مستشفى قصر العيني"} |
How to Get Started
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "hananelhosary8/Nile-Chat-4B-Transit-Extractor"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")