TribalBus AI: A multilingual intent classifier for bus ticket booking
2 min readupdated
This project is a conversational AI research system built to recognize passenger requests and book bus tickets. The model understands messages in English, Urdu, Pashto, and their Romanized transliterations, extracting key entities like departure and arrival cities, dates, times, and seat counts. It classifies user intent into 14 categories and forwards requests to the booking backend. The system combines classical methods (TF-IDF and LinearSVC) with the Qwen3-0.6B transformer model, fine-tuned using PEFT and LoRA (a lightweight adapter for efficient model training).
Key features
- Support for English, Urdu, Pashto, and Romanized transliterations.
- Recognition of 14 intent types (flight search, seat checking, schedules, booking, cancellation, and more).
- Extraction of 6 entity categories (departure city, destination, date, time, seat count, and booking ID).
- A hybrid approach combining a LinearSVC classifier and a Qwen3-0.6B transformer with LoRA.
- A security architecture requiring mandatory confirmation before performing booking operations.
What you can do
- Apply the model in a customer support chatbot for bus services to automatically process text requests from passengers.
- Set up multilingual routing for incoming messages in various languages and dialects.
- Use the entity extraction module to automatically fill in ticket order fields from phrases like "two seats from Islamabad to Lahore tomorrow evening".
- Integrate research artifacts and the LoRA adapter into your own natural language processing (NLP) pipelines using PyTorch and Transformers.
Example
An example of the data structure the system should generate when parsing a user message:
{
"intent": "book_ticket",
"entities": {
"origin": "Parachinar",
"destination": "Islamabad",
"travel_date": "tomorrow",
"departure_time": "evening",
"seats": 2,
"booking_id": null
},
"requires_confirmation": true
}Read more
Details• Experiment accuracy: the fine-tuned Qwen LoRA reached 78.95% on the test set, while the hybrid classifier achieved 79.21% on validation.
• LoRA architecture: rank 16, alpha 32, dropout 0.05.
• Dataset: 1,510 records (after cleaning and augmentation), split into training, validation, and test sets.
• Limitations: the Pashto-specific classifier showed lower accuracy (56.99%) due to complexities with schedules and trip searches.










Comments