A newer version of the Gradio SDK is available:
6.1.0
π Medical Q&A Bot - UI Implementation Complete!
β What You Now Have
π₯οΈ Two Complete Web Interfaces
1. Gradio Interface (app.py) - RECOMMENDED β
- Clean, modern design with gradient styling
- Dual-view mode (Formatted + JSON)
- Built-in example queries
- Easy to share and deploy
- Automatic REST API generation
- Launch with:
python app.py - Access at: http://127.0.0.1:7860
2. Streamlit Interface (app_streamlit.py) - ALTERNATIVE
- Interactive sidebar with live controls
- Card-based result display
- Progress bars and metrics
- More customization options
- Launch with:
streamlit run app_streamlit.py - Access at: http://localhost:8501
π Complete Documentation Suite
Quick Start Guides
- QUICKSTART.md - Step-by-step setup (5 minutes)
- launch_ui.bat - Windows batch launcher (double-click to run)
- launch_ui.ps1 - PowerShell launcher (right-click β Run with PowerShell)
- setup_ui.py - Automated setup script
Comprehensive Documentation
- UI_README.md - Complete UI feature documentation
- UI_IMPLEMENTATION.md - Implementation details and summary
- ARCHITECTURE.md - System architecture with diagrams
- PRESENTATION_SCRIPT.md - Complete presentation guide with demo script
π How to Get Started (3 Easy Steps)
Option 1: PowerShell Launcher (Easiest!)
# Just double-click or run:
.\launch_ui.ps1
Option 2: Command Line
# 1. Install dependencies
pip install -r requirements.txt
# 2. Build data (if needed)
python -m adapters.build_corpora
# 3. Launch!
python app.py
Option 3: Setup Script
# Run the automated setup
python setup_ui.py
# Then launch
python app.py
π¨ Key Features
Classification
β Automatic query classification (Medical/Administrative/Other) β Confidence scores for transparency β Visual indicators and progress bars β Color-coded results
Retrieval
β Hybrid search (BM25 + Dense + RRF) β Retrieves from PubMed, Miriad, and UniDoc β Adjustable number of results (1-50) β Optional cross-encoder reranking β Multiple relevance scores per document
User Experience
β Clean, professional interface β Example queries built-in β Real-time processing β Formatted and JSON view modes β Mobile-responsive design β Error handling and validation
π New Files Created
health-query-classifier/
βββ π Web Interfaces
β βββ app.py β (Main Gradio UI)
β βββ app_streamlit.py (Alternative Streamlit UI)
β βββ launch_ui.bat (Windows launcher)
β βββ launch_ui.ps1 (PowerShell launcher)
β
βββ π Documentation
β βββ QUICKSTART.md (5-minute setup guide)
β βββ UI_README.md (Feature documentation)
β βββ UI_IMPLEMENTATION.md (Technical summary)
β βββ ARCHITECTURE.md (System diagrams)
β βββ PRESENTATION_SCRIPT.md (Demo script)
β βββ UI_SUMMARY.md (This file)
β
βββ π§ Setup Tools
β βββ setup_ui.py (Automated installer)
β
βββ π¦ Updated Files
βββ requirements.txt (Added gradio + streamlit)
π― What Each Interface Looks Like
Gradio Interface Features:
βββββββββββββββββββββββββββββββββββββββββββ
β π₯ Medical Q&A Bot β
β Health Query Classifier & Retriever β
β Team: David β’ Tarak β’ Sravani β’ etc. β
βββββββββββββββββββββββββββββββββββββββββββ€
β β
β [Enter your health query...] β
β βββββββββββββββββββββββββββββββββββ β
β β Number of Results: [10] β β
β β β Use Reranker β β
β βββββββββββββββββββββββββββββββββββ β
β β
β [π Analyze Query] β
β β
βββββββββββββββββββββββββββββββββββββββββββ€
β Classification Result: β
β β MEDICAL (95% confidence) β
β - Medical: 95.2% ββββββββββββ β
β - Administrative: 4.8% β β
βββββββββββββββββββββββββββββββββββββββββββ€
β [π Formatted View] [π JSON View] β
β β
β Found 10 Relevant Documents β
β βββββββββββββββββββββββββββββββββ β
β β Result #1: Eczema Treatment β β
β β BM25: 0.85 Dense: 0.92 RRF: 1.2β β
β β Text: Treatment options for...β β
β βββββββββββββββββββββββββββββββββ β
β ... β
βββββββββββββββββββββββββββββββββββββββββββ
Streamlit Interface Features:
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β βοΈ Settings β π₯ Medical Q&A Bot β
β β βββββββββββββββββββββββ β
β Results: 10 β β
β ββββββββ β [Query input box...] β
β β β
β β Reranker β [π Analyze Query] β
β β β
β β JSON View β Classification: β
β β π₯ MEDICAL β
β Examples: β β
β β’ Rash... β Confidence: β
β β’ Vaccine...β ββββββββββββ 95% β
β β’ Headache..β β
β β Results: β
β β βββββββββββββββββββ β
β β β Result #1 β β
β β β BM25 β Dense β β
β β β 0.85 β 0.92 β β
β β βββββββββββββββββββ β
βββββββββββββββ΄ββββββββββββββββββββββββββββ
π‘ Demo Workflow
Perfect Demo Sequence:
- Start β Launch UI (
python app.py) - Medical Query β "I have a rash on my hands..."
- Show classification
- Show retrieved documents
- Point out scores
- Admin Query β "Can I get an appointment?"
- Show different classification
- No retrieval happens
- Settings β Adjust results, toggle reranker
- Views β Switch between formatted and JSON
π For Your Presentation
Talking Points:
β "We built a professional web interface using Gradio" β "The system classifies queries in real-time" β "For medical queries, it retrieves relevant research" β "Uses hybrid search with BM25 and dense embeddings" β "Optional reranking for improved accuracy" β "Clean, intuitive user experience"
What to Demo:
β Classification confidence scores β Document retrieval results β Different query types (medical vs admin) β Settings adjustment (reranker, result count) β Multiple view modes (formatted + JSON)
Impressive Technical Details:
β Sentence transformer embeddings β Neural network classifier β FAISS vector search β RRF fusion algorithm β Cross-encoder reranking β Professional UI framework
π οΈ Troubleshooting
Common Issues:
"Module not found: gradio"
pip install gradio
"No corpora files found"
python -m adapters.build_corpora
"Port already in use"
# Edit app.py line ~255
demo.launch(server_port=8080) # Change port
"Models loading slowly"
- This is normal on first run
- Models are cached afterward
- Takes 30-60 seconds initially
π Why This Implementation is Great
For Your Project:
β Professional appearance β Easy to demonstrate β Well-documented β Production-ready foundation β Impressive to stakeholders
For Your Resume:
β Modern tech stack (Gradio, PyTorch, Transformers) β Full-stack development (UI + ML backend) β Healthcare application (impactful domain) β Clean, maintainable code β Comprehensive documentation
For Future Development:
β Easy to extend β Modular architecture β Multiple deployment options β API already available β Scalable design
π File Sizes
app.py ~9 KB (Main UI)
app_streamlit.py ~7 KB (Alt UI)
QUICKSTART.md ~5 KB (Setup guide)
UI_README.md ~8 KB (Features)
UI_IMPLEMENTATION.md ~10 KB (Details)
ARCHITECTURE.md ~15 KB (Diagrams)
PRESENTATION_SCRIPT.md ~12 KB (Demo guide)
Total new documentation: ~66 KB of helpful guides!
π― Next Steps
Immediate (5 minutes):
- Run
pip install gradio streamlit - Launch UI with
python app.py - Test with example queries
- Familiarize yourself with features
Short Term (1 hour):
- Read through QUICKSTART.md
- Test both Gradio and Streamlit interfaces
- Prepare demo queries
- Practice presentation flow
Before Presentation:
- Review PRESENTATION_SCRIPT.md
- Test demo multiple times
- Prepare backup slides
- Assign team roles
- Get excited! π
π€ Team Credits
Built by:
- David Gray
- Tarak Jha
- Sravani Segireddy
- Riley Millikan
- Kent R. Spillner
Technologies Used:
- Python 3.8+
- PyTorch
- Sentence-Transformers
- Gradio
- Streamlit
- FAISS
- BM25
- scikit-learn
π You're All Set!
Your medical Q&A bot now has: β Two professional web interfaces β Complete documentation β Easy launchers β Presentation guide β Demo script β Architecture diagrams
Everything you need for a successful demo and presentation!
π Quick Commands Reference
# Install everything
pip install -r requirements.txt
# Build data
python -m adapters.build_corpora
# Launch Gradio UI (recommended)
python app.py
# Launch Streamlit UI (alternative)
streamlit run app_streamlit.py
# Run automated setup
python setup_ui.py
# Use launcher scripts
.\launch_ui.ps1
π Need Help?
- Check QUICKSTART.md for setup issues
- Check UI_README.md for feature questions
- Check ARCHITECTURE.md for technical details
- Check PRESENTATION_SCRIPT.md for demo help
- Ask your team members!
β¨ Final Notes
This implementation provides:
- Professional quality - Ready to show to professors, potential employers
- Well-documented - Easy for team members to understand
- Extensible - Can be built upon for future projects
- Portfolio-worthy - Great addition to your GitHub
You've got an impressive project here. Go show it off! π
Created: December 3, 2025 For: Health Query Classifier Group Project By: Your friendly AI assistant