This guide will help you set up and use the new T5 Model Training GUI - a web interface for training your NL2SPARQL model without touching code or JSON files.
Backend:
cd microservices
pip install -r requirements.txtFrontend:
cd rasa-frontend
npm installTerminal 1 - Backend:
cd microservices
python app.pyTerminal 2 - Frontend:
cd rasa-frontend
npm start- Open browser:
http://localhost:3000 - Navigate to: Settings → T5 Model Training tab
- Start adding training examples!
- Write natural language questions
- Select sensors from dropdown (680+ sensors)
- Enter SPARQL queries
- Categorize examples
- Add notes
- View all training examples in a table
- Edit existing examples
- Delete unwanted examples
- Refresh to see latest changes
- Set training epochs (1-50)
- Start training with one click
- Monitor progress in real-time
- View detailed training logs
- See completion status
- Deploy trained models to production
- Automatic backup of current model
- View all available models
- Check model sizes and dates
Question:
What is the correlation between temperature and humidity in zone 5.04?
Select Sensors:
- Zone_Air_Temperature_Sensor_5.04
- Zone_Air_Humidity_Sensor_5.04
SPARQL Query:
SELECT ?sensor ?timeseriesId ?storedAt
WHERE {
VALUES ?sensor {
bldg:Zone_Air_Humidity_Sensor_5.04
bldg:Zone_Air_Temperature_Sensor_5.04
}
?sensor brick:hasLocation ?location .
?sensor brick:timeseries ?timeseries .
?timeseries ref:hasTimeseriesId ?timeseriesId .
?timeseries ref:storedAt ?storedAt .
}Category: Multi-Sensor Correlation
Notes: Zone 5.04 correlation query
- Set epochs to 10
- Click Start Training
- Wait ~5-10 minutes
- Watch progress bar and logs
- After training completes, click Deploy Model to Production
- Go to Action Server tab
- Click Restart Action Server
- Test your queries!
| Examples | Epochs | Time Estimate |
|---|---|---|
| 10 | 10 | 5-10 minutes |
| 10 | 15 | 7-15 minutes |
| 25 | 10 | 10-20 minutes |
| 50 | 10 | 15-30 minutes |
Times vary based on hardware (GPU/CPU)
- Question field: Natural language input
- Sensor selector: Multi-select dropdown with search
- SPARQL editor: Monospace text area for queries
- Category dropdown: Organize by type
- Notes field: Add context or reminders
- Displays all training examples
- Shows question, entity count, category, notes
- Edit (✏️) and Delete (🗑️) buttons
- Refresh button to reload
- Example counter in header
- Progress bar: Visual progress indicator (0-100%)
- Status badge: RUNNING / COMPLETED / ERROR
- Training logs: Real-time console output
- Auto-scroll: Always shows latest logs
- Deploy button: Appears after successful training
- Lists all trained model checkpoints
- Shows last modified date/time
- Displays model size in MB
- Highlights production model with badge
┌─────────────────┐ ┌─────────────────┐
│ React Frontend │ ◄─────► │ Flask Backend │
│ (Port 3000) │ REST │ (Port 6000) │
└─────────────────┘ API └─────────────────┘
│
▼
┌─────────────────┐
│ quick_train.py │
│ T5 Fine-tuning │
└─────────────────┘
GET /api/t5/sensors- Load sensor listGET /api/t5/examples- Get training examplesPOST /api/t5/examples- Add new examplePUT /api/t5/examples/:id- Update exampleDELETE /api/t5/examples/:id- Delete examplePOST /api/t5/train- Start trainingGET /api/t5/train/:jobId/status- Poll training statusPOST /api/t5/deploy- Deploy to productionGET /api/t5/models- List models
Training Examples:
Transformers/t5_base/training/bldg1/correlation_fixes.json
Trained Models:
Transformers/t5_base/trained/checkpoint-quick-fix/
Transformers/t5_base/trained/checkpoint-3/ (production)
Sensor List:
rasa-bldg1/actions/sensor_list.txt
File: microservices/blueprints/t5_training.py
# Path configurations
T5_BASE_DIR = '../../Transformers/t5_base'
TRAINING_DATASET = 'training/bldg1/correlation_fixes.json'
SENSOR_LIST_FILE = '../../rasa-bldg1/actions/sensor_list.txt'Adjustable in GUI or via code:
- Epochs: 1-50 (default: 10)
- Batch size: 2 (default)
- Learning rate: 3e-5 (default)
- Base checkpoint: checkpoint-3 (production model)
- ✅ "What is the CO2 level in zone 5.04?"
- ✅ "Show correlation between temperature and humidity"
- ❌ "sensor query" (too vague)
- ❌ "give me data" (not specific)
Multi-Sensor (Use VALUES):
VALUES ?sensor { bldg:Sensor1 bldg:Sensor2 }Single Sensor (Direct):
bldg:Sensor1 brick:hasLocation ?location .- Start with 5-10 examples
- Train for 10 epochs
- Test in chatbot
- Add more examples for failures
- Re-train incrementally
- Keep backups of successful models
- Test before deploying to production
- Document what each training session improves
- Use notes field to track changes
- Check
sensor_list.txtexists - Verify backend is running (port 6000)
- Refresh the page
- Ensure at least 1 example exists
- Check no other training is running
- Verify Python environment has all dependencies
- Restart action server (Action Server tab)
- Wait for restart to complete
- Clear browser cache and retry
- Check SPARQL syntax in examples
- Verify sensor names are correct
- Ensure JSON format is valid
- Check Python dependencies installed
- GUI_TRAINING_GUIDE.md: Detailed GUI usage guide
- QUICK_TRAIN_GUIDE.md: Command-line quick training
- TRAINING_GUIDE.md: Full training documentation
- SOLUTION_SUMMARY.md: Technical implementation details
Problem: Model generates syntax errors for multi-sensor queries
Solution:
- Add 5-10 examples with correct VALUES clause pattern
- Train for 10 epochs
- Deploy and test
Problem: Model doesn't handle new sensor types
Solution:
- Add examples for each new sensor type
- Include various question phrasings
- Train for 15 epochs
- Deploy and verify
Problem: Model struggles with nested or complex queries
Solution:
- Add examples breaking down the complexity
- Include subquery patterns
- Train for 20 epochs
- Test incrementally
- GUI runs on localhost only by default
- No authentication required (local development)
- Training data stored locally
- Models stored locally
For production deployment:
- Add authentication
- Implement access controls
- Use HTTPS
- Secure API endpoints
- ✅ Complete setup following Quick Start
- ✅ Add your first training example
- ✅ Train with 10 epochs
- ✅ Deploy and test
- ✅ Iterate based on results
- Use search in sensor dropdown: Type to filter 680+ sensors
- Copy-paste SPARQL: Test queries first, then paste
- Monitor logs during training: Catch errors early
- Keep notes updated: Document what each example teaches
- Start small: 5-10 good examples > 50 mediocre ones
- Test immediately: Deploy and test after each training session
For issues or questions:
- Check training logs in GUI
- Review console output of services
- Read troubleshooting section above
- Check individual guide files
Happy Training! 🎉
Your T5 model is now trainable with just a few clicks!