This project implemented a conversational railway assistant using a fine-tuned T5-Base Transformer model. The system converted multi-turn railway conversations into structured JSON states by extracting user intent, destination, preferences, constraints, and conversation status.
- Intent classification (
search_train,platform_info,check_disruptions) - Multi-turn context retention
- User correction handling
- Constraint and preference extraction
- Structured JSON state generation
- Lightweight frontend for inference
- Synthetic railway conversation dataset
- ~8,500 conversation samples
- Conversation-to-JSON state mapping
- T5-Base (Encoder-Decoder Transformer)
- Fine-tuned using Hugging Face Transformers
- Trained on Google Colab GPU with FP16 mixed precision
The model was evaluated using:
- Exact JSON Match Accuracy
- Intent Accuracy
- Destination Accuracy
- Constraint Accuracy
- Status Accuracy
- ROUGE-1
- ROUGE-2
- ROUGE-L
User: Cheapest train to Manchester tomorrow
{
"intent": "search_train",
"destination": "Manchester",
"time_context": "tomorrow",
"preference": "cheapest",
"status": "new_search"
}- Python
- PyTorch
- Hugging Face Transformers
- T5-Base
- Pandas
- NumPy
- Google Colab
├── notebook.ipynb
├── railway_dataset.csv
├── saved_model/
├── frontend/
├── README.md
└── requirements.txt
The solution successfully demonstrated conversational state tracking by maintaining context, processing user updates, and generating structured railway states suitable for downstream journey-planning systems.