Instructions to use sharjeel01/TribalBus-AI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sharjeel01/TribalBus-AI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sharjeel01/TribalBus-AI")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sharjeel01/TribalBus-AI", device_map="auto") - PEFT
How to use sharjeel01/TribalBus-AI with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- TribalBus AI
- 1. Project Overview
- 2. Supported Languages
- 3. Intent Classification
- 4. Entity Extraction
- 5. Model Architecture
- 6. Dataset Development
- 7. Training Methodology
- 8. Experimental Results
- 9. Backend Action Architecture
- 10. Inference and Deployment
- 11. Security and Privacy
- 12. Limitations and Future Work
- 13. Repository Structure
- 14. Responsible Use
- 15. Project Status
- 16. Project Identity
TribalBus AI
A Multilingual Conversational Intelligence System for Bus Transportation and Booking
TribalBus AI is a multilingual conversational AI research and development project designed to understand user requests related to bus transportation, travel information, schedules, fares, seat availability, and ticket booking.
The project focuses on making bus transportation systems more accessible through natural-language interaction across English, Urdu, Pashto, and Roman-script communication.
Instead of requiring users to navigate complex booking menus, TribalBus AI aims to understand what a passenger wants to do, identify relevant travel information, and connect the request to the appropriate backend operation.
The project combines traditional machine-learning classification, multilingual text processing, language-aware routing, and parameter-efficient transformer fine-tuning.
Project objective: Build a multilingual conversational intelligence layer that can understand passenger requests and safely connect them to an existing bus reservation system.
1. Project Overview
| Attribute | Description |
|---|---|
| Project name | TribalBus AI |
| Project category | Multilingual Conversational AI |
| Primary domain | Bus transportation and ticket booking |
| Primary task | Intent classification |
| Additional tasks | Language-aware routing and entity extraction |
| Supported languages | English, Urdu, Pashto, Roman Urdu, Roman Pashto |
| Intent categories | 14 |
| Entity categories | 6 |
| Machine-learning methods | TF-IDF, LinearSVC, hybrid classification |
| Deep-learning method | Transformer transfer learning |
| Fine-tuning technique | PEFT / LoRA |
| Model framework | Scikit-learn, PyTorch, Transformers |
| Deployment target | Existing bus-booking backend and Hugging Face Spaces |
| Repository status | Research artifacts uploaded; application integration pending |
Core Capabilities
TribalBus AI is designed to:
- Understand passenger messages in multiple languages.
- Classify travel-related user intentions.
- Identify important information such as departure cities and destinations.
- Recognize travel dates, departure times, seat counts, and booking references.
- Route requests to the appropriate conversational or backend operation.
- Handle unsupported or unclear requests through a fallback intent.
- Require confirmation before sensitive booking operations.
2. Supported Languages
The project targets multilingual interaction across the following language formats.
| Language | Input format | Development status |
|---|---|---|
| English | Latin script | Supported |
| Urdu | Urdu script | Supported |
| Pashto | Arabic-derived Pashto script | Experimental |
| Roman Urdu | Latin script | Supported in dataset coverage |
| Roman Pashto | Latin script | Experimental |
Language considerations
Multilingual support does not mean identical accuracy across all languages.
English and Urdu have shown stronger results in some validation experiments, while Pashto remains an important area for further improvement.
Regional Pashto expressions, especially conversational wording, spelling variations, and dialect-specific vocabulary, require additional native-speaker validation.
Roman Urdu and Roman Pashto may also contain inconsistent spelling, transliteration, and mixed-language expressions. These variations must be considered during real-world evaluation.
3. Intent Classification
The system defines 14 conversational intent categories.
An intent represents the purpose behind a user's message.
| # | Intent | Purpose |
|---|---|---|
| 1 | greeting |
Greetings and conversation initiation |
| 2 | general_question |
General questions about the service |
| 3 | search_bus |
Searching for buses between locations |
| 4 | check_schedule |
Asking about departure or arrival schedules |
| 5 | check_availability |
Checking available seats |
| 6 | check_fare |
Asking about ticket prices |
| 7 | book_ticket |
Requesting a ticket reservation |
| 8 | cancel_booking |
Requesting cancellation |
| 9 | booking_status |
Checking an existing booking |
| 10 | route_information |
Asking about routes and destinations |
| 11 | payment_information |
Asking about payment methods |
| 12 | change_booking |
Requesting a booking modification |
| 13 | emergency |
Emergency-related requests |
| 14 | fallback |
Handling unclear or unsupported requests |
Example interactions
| User message | Expected intent |
|---|---|
| Find a bus from Islamabad to Lahore. | search_bus |
| What time does the bus leave? | check_schedule |
| Are seats available tomorrow? | check_availability |
| How much is the ticket? | check_fare |
| I want to reserve two seats. | book_ticket |
| Cancel my reservation. | cancel_booking |
| Where is my booking? | booking_status |
| I need to change my travel date. | change_booking |
| Ψ³ΩΨ§Ω Ψ Ϊ ΩΪ«Ω ΫΫΨ | greeting |
| Ω Ψ¬ΪΎΫ Ψ§Ψ³ΩΨ§Ω Ψ’Ψ¨Ψ§Ψ― Ψ³Ϋ ΩΎΨ΄Ψ§ΩΨ± Ψ¬Ψ§ΩΨ§ ΫΫΫ | search_bus |
These are illustrative examples, not a claim that every sentence is already correctly classified.
4. Entity Extraction
Intent classification identifies what the passenger wants to do.
Entity extraction identifies the information contained in the message.
TribalBus AI defines six entity categories.
| Entity | Description | Example |
|---|---|---|
origin |
Departure location | Parachinar |
destination |
Arrival location | Islamabad |
travel_date |
Intended travel date | Tomorrow |
departure_time |
Preferred departure time | 8 PM |
seats |
Number of seats | 2 |
booking_id |
Existing booking reference | TB12345 |
Example
User message:
"I want two seats from Parachinar to Islamabad tomorrow evening."
Expected structured information:
{
"intent": "book_ticket",
"entities": {
"origin": "Parachinar",
"destination": "Islamabad",
"travel_date": "tomorrow",
"departure_time": "evening",
"seats": 2,
"booking_id": null
},
"requires_confirmation": true
}
The structured output is an illustrative target format. Actual entity extraction and date normalization must be implemented and validated in the inference pipeline.
5. Model Architecture
TribalBus AI is developed using a combination of machine-learning and transformer-based approaches.
5.1 Hybrid Intent Classification
The project includes a hybrid text-classification approach using word-level and character-level text representations.
Word-level features help capture meaningful words and phrases.
Character-level features help recognize spelling variations, transliteration differences, and partially overlapping word forms.
The extracted features are processed by a Linear Support Vector Classifier (LinearSVC).
This approach is particularly useful for multilingual text where spelling and writing styles can vary.
5.2 Language-Aware Classification
A separate language-aware classification experiment was developed to investigate routing user messages to appropriate language-specific processing.
The project includes:
- Multilingual intent classification.
- Language detection experiments.
- Pashto-specific classification.
- Automatic routing experiments.
Language detection performance must be evaluated on representative, independently collected samples, especially for mixed-language and Roman-script messages.
5.3 Pashto Specialist Classifier
A dedicated Pashto specialist model was developed using a word-and-character TF-IDF representation and LinearSVC.
The model was evaluated against the original Pashto training data and a Qehwa-generated Pashto augmentation experiment.
The augmented experiment showed a modest improvement in validation performance, but Pashto classification still requires substantial improvement before production use.
5.4 Transformer Transfer Learning
The project also includes a transformer-based classification experiment using:
- Base architecture: Qwen3-0.6B
- Training method: Transfer Learning
- Fine-tuning approach: PEFT
- Parameter-efficient technique: LoRA
- Adapter rank: 16
- LoRA alpha: 32
- LoRA dropout: 0.05
LoRA reduces the number of trainable parameters by learning low-rank adapter updates instead of fully fine-tuning every model parameter.
The trained adapter is included as a separate artifact.
Loading this adapter requires the compatible base model and its dependencies.
6. Dataset Development
The project dataset was developed through multiple stages.
Dataset progression
| Stage | Records |
|---|---|
| Initial seed dataset | 42 |
| First synthetic dataset | 1,260 |
| Deduplicated dataset | 617 |
| Offline augmentation stage | 1,075 |
| Improved augmented dataset | 1,510 |
| Train split | 984 |
| Validation split | 279 |
| Test split | 247 |
The 1,510-record dataset was split into training, validation, and test subsets.
Subsequent experiments also generated additional training examples, including multilingual API-assisted augmentation and Pashto-specific augmentation.
Dataset counts from different experimental stages should not be added together as though they represent independent unique records. Some later datasets are derived from earlier datasets.
Dataset splitting
The project used a group-based splitting strategy to reduce template overlap between training and validation examples.
The original split was:
- Training: 984 records
- Validation: 279 records
- Test: 247 records
The test set was used for an initial evaluation and was not used for subsequent training.
Data generation
The project used a combination of:
- Seed examples.
- Rule-based synthetic examples.
- Offline augmentation.
- API-assisted multilingual augmentation.
- Pashto-specific generated examples.
Synthetic examples improve data coverage but do not replace real passenger conversations or native-speaker review.
7. Training Methodology
The development process included:
- Defining intent and entity schemas.
- Preparing initial multilingual examples.
- Generating additional synthetic training samples.
- Removing duplicate examples.
- Creating group-based dataset splits.
- Training baseline machine-learning classifiers.
- Fine-tuning a transformer using LoRA.
- Evaluating different classification approaches.
- Performing language-specific error analysis.
- Packaging the final research artifacts.
Machine-learning techniques
- TF-IDF vectorization.
- Word n-grams.
- Character n-grams.
- Linear Support Vector Classification.
- Class balancing.
- Cross-validation.
- Validation-based model selection.
Deep-learning techniques
- Transformer transfer learning.
- PEFT.
- LoRA.
- Early stopping and validation-based selection.
8. Experimental Results
The project contains multiple experiments with different datasets, model configurations, and evaluation splits.
The following results are reported from their respective experiments.
| Experiment | Evaluation split | Accuracy |
|---|---|---|
| Cell 26.1 β Improved Qwen LoRA | Test | 78.95% |
| Cell 27 β Hybrid intent classifier | Validation | 79.21% |
| Cell 28 β Baseline hybrid | Validation | 74.19% |
| Cell 28 β Augmented hybrid | Validation | 74.55% |
| Cell 29 β General multilingual classifier | Validation | 79.21% |
| Cell 30 β Original Pashto specialist | Validation | 54.84% |
| Cell 30 β Qehwa-augmented Pashto specialist | Validation | 56.99% |
Important: These figures are not directly comparable because the experiments used different data versions, model configurations, and evaluation settings.
The highest accuracy in one experiment does not establish that it is the best model for every language or intent.
Selected experimental observations
- Hybrid classification produced strong validation macro-F1 in one experiment.
- Multilingual performance varied by language.
- Pashto-specific augmentation produced a modest improvement in the tested experiment.
- Schedule-related and bus-search-related Pashto messages remained a major source of confusion.
- Synthetic data quality and language-specific coverage are important limitations.
Pashto error analysis
The Pashto validation experiment contained 93 samples.
- Correct predictions: 53
- Incorrect predictions: 40
- Accuracy: 56.99%
Major confusion included:
check_schedulepredicted assearch_bus.search_buspredicted asbook_ticket.
These findings indicate that similar travel-related expressions need more varied and carefully labeled training examples.
9. Backend Action Architecture
TribalBus AI is designed as an intelligence layer rather than a standalone reservation database.
Its role is to interpret a user request and produce a structured action proposal.
The existing backend remains responsible for executing and validating operations.
| Intent | Proposed backend operation |
|---|---|
search_bus |
search_buses |
check_schedule |
get_schedule |
check_availability |
check_seats |
check_fare |
get_fare |
book_ticket |
request_booking |
cancel_booking |
request_cancellation |
booking_status |
get_booking_status |
route_information |
get_routes |
payment_information |
get_payment_methods |
change_booking |
request_booking_change |
emergency |
trigger_sos |
Conversational intents such as greetings and general questions can be handled by the chatbot response layer.
Booking safety
The following operations require explicit confirmation:
- Booking a ticket.
- Cancelling a reservation.
- Changing an existing reservation.
The backend must:
- Validate all entities.
- Authenticate the user.
- Check current availability.
- Validate booking ownership.
- Require explicit confirmation.
- Execute the operation.
- Return a verified result.
The classifier must never directly execute database operations or treat generated text as authorization.
10. Inference and Deployment
The trained artifacts are intended to support an inference service.
A production inference pipeline should include:
- Input validation.
- Language detection or language selection.
- Appropriate classifier routing.
- Intent prediction.
- Confidence estimation and rejection handling.
- Entity extraction.
- Entity normalization.
- Structured response generation.
- Backend action proposal.
- Backend authorization and confirmation.
Hugging Face deployment options
The project can be exposed through:
- Hugging Face Spaces with Gradio for an interactive chatbot.
- A custom API service for application integration.
- A dedicated deployment environment for production workloads.
The current repository upload contains model artifacts and research documentation. It does not, by itself, establish that a production inference endpoint or a complete booking chatbot is already running.
Production requirements
Before real-world deployment, the inference service needs:
- A verified model-loading pipeline.
- A tested multilingual prediction interface.
- Entity extraction and normalization.
- Input validation.
- Confidence thresholds.
- Error handling.
- Authentication where required.
- Monitoring and logging.
- Backend API integration.
- Load and latency testing.
11. Security and Privacy
Security is a fundamental requirement for a transportation and booking assistant.
The following principles apply:
- API keys must be stored in secure environment variables or secret managers.
- Customer information must not be exposed in model logs.
- Booking references must be validated against authenticated users.
- Sensitive operations must require explicit confirmation.
- Model output must be treated as untrusted input.
- Database access must remain inside the authorized backend.
- Public model repositories must not contain private credentials or customer records.
12. Limitations and Future Work
TribalBus AI is a research and development project. Its current experimental results should not be interpreted as a guarantee of production performance.
Current limitations
- Training data includes synthetic examples.
- Performance differs across languages.
- Pashto classification requires further improvement.
- Roman-script language variation remains challenging.
- Some intent categories have limited validation support.
- Entity extraction and normalization need an independently tested inference pipeline.
- Real-time bus availability and ticket reservations require integration with the existing backend.
- Production latency, scalability, and reliability have not yet been established.
Future development
- Expand native-speaker-verified Pashto datasets.
- Collect representative real-world passenger messages with appropriate consent.
- Improve confusion between search, schedule, and booking intents.
- Strengthen entity extraction and date normalization.
- Implement confidence-based fallback handling.
- Build a Hugging Face Spaces inference interface.
- Integrate with the existing bus booking system.
- Test real-time booking workflows.
- Evaluate latency and production reliability.
- Perform broader multilingual user acceptance testing.
13. Repository Structure
The repository contains trained models, datasets, evaluation artifacts, research documentation, and a complete project backup.
The main artifact categories include:
- Hybrid intent classification models.
- Pashto specialist model.
- Language-aware classifier.
- Transformer LoRA adapter.
- Training and augmentation datasets.
- Model evaluation reports.
- Experiment history.
- Complete project files.
- Project archive.
Refer to the repository file browser for the exact file names and paths.
14. Responsible Use
TribalBus AI provides predictions and structured information to support a bus booking application.
It is not an independent authority for actual seat availability, fares, ticket confirmation, payment status, or emergency response.
Those operations must be verified by the connected transportation backend or appropriate authorized service.
Users should receive accurate information from the actual reservation system rather than unverified model-generated claims.
15. Project Status
| Component | Status |
|---|---|
| Dataset preparation | Completed experimental stages |
| Multilingual intent classification | Experimentally developed |
| Hybrid classifier | Trained and evaluated |
| Pashto specialist | Trained and evaluated |
| Transformer LoRA experiment | Trained and evaluated |
| Research documentation | Prepared |
| Hugging Face artifact upload | Completed and verified |
| Production inference application | Pending implementation |
| Existing booking system integration | Pending |
| Production user testing | Pending |
16. Project Identity
TribalBus AI
A multilingual conversational intelligence project for accessible bus transportation and reservation workflows.
Repository: sanaullah7964/TribalBus-AI
Primary objective: Understand passenger requests across languages and connect them safely to existing transportation services.
This repository documents the current research artifacts, experiments, and development status. Performance and deployment claims should be updated as new independently verified results become available.