NO API KEYS REQUIRED — Works Completely Offline
| Feature | Original | Improved Version |
|---|---|---|
| API Requirements | Groq API key required | ✅ No API keys needed |
| Scenarios | AI-generated on-the-fly | ✅ Pre-built library (coach-editable) |
| Corrections | AI-powered via Groq | ✅ Rule-based pattern matching |
| Student Accounts | Username only | ✅ Simple login, no setup needed |
| Coach Dashboard | ❌ Not available | ✅ Full dashboard with insights |
| Common Mistakes | ❌ Not tracked across students | ✅ Class-wide analysis |
| Areas of Opportunity | ❌ Not identified | ✅ Automatically highlighted |
Fluency Engine is an adaptive spoken English training platform that:
- Presents practice scenarios from a pre-built library organized by CEFR level (A1-C2)
- Records and analyzes spoken responses using local speech processing
- Delivers corrective feedback using rule-based grammar detection
- Tracks progress across sessions with personalized error memory
- Provides coach insights through a comprehensive dashboard
Core loop:
SCENARIO (from library, CEFR-calibrated)
↓
RECORD (microphone or file upload)
↓
ANALYSIS (Whisper + librosa — local processing)
↓
CORRECTIONS (rule-based pattern matching)
↓
SESSION LOGGED → LEVEL RECALIBRATED → NEXT SCENARIO
↓
REPEAT (infinite, personalised)
- Students needed to create Groq API accounts
- Not all students understand what an API is
- API credits can run out
- Complex setup process
- Zero setup for students — just enter a username and start
- Coach manages everything — scenarios, monitoring, insights
- Works offline — no internet required for core functionality
- Scalable — add unlimited students without API costs
| Level | Label | WPM Target | Filler Target | Connector Req. | Score |
|---|---|---|---|---|---|
| A1 | Beginner | 60–80 | ≤8/min | None | 30–40 |
| A2 | Elementary | 80–100 | ≤6/min | Sequencing | 40–52 |
| B1 | Intermediate | 100–130 | ≤4/min | + Contrast | 52–65 |
| B2 | Upper-Int. | 130–155 | ≤3/min | 3+ types | 65–76 |
| C1 | Advanced | 155–175 | ≤2/min | 4+ types | 76–88 |
| C2 | Mastery | 160–180 | ≤1.5/min | Full discourse | 88–100 |
Level progression is automatic: 3 consecutive sessions at/above threshold → advance.
| Layer | Tool |
|---|---|
| Frontend | Streamlit |
| Audio recording | audio-recorder-streamlit |
| Transcription | OpenAI Whisper (local, tiny model) |
| Acoustic analysis | librosa · numpy · scipy |
| Scenario library | JSON files (editable by coach) |
| Correction engine | Rule-based pattern matching |
| Session storage | JSON files (username-keyed) |
| PDF reports | reportlab |
| Deployment | Streamlit Cloud or local |
fluency-engine-improved/
├── app.py ← Main Streamlit app (student + coach views)
├── core/
│ ├── analyze.py ← Audio processing: WPM, pauses, fillers
│ ├── score.py ← Fluency formula, connector detection
│ ├── rule_feedback.py ← Rule-based grammar corrections (NEW)
│ ├── scenario_manager.py ← Pre-built scenario library (NEW)
│ ├── storage.py ← Session storage + error memory
│ ├── coach_dashboard.py ← Coach analytics and insights (NEW)
│ └── pdf_report.py ← PDF report generation
├── data/
│ ├── cefr_thresholds.json ← Level boundaries and targets
│ ├── connector_taxonomy.json ← 8 connector types with word lists
│ ├── filler_patterns.json ← Regex patterns for filler detection
│ ├── scenario_library.json ← Pre-built scenarios by level (NEW)
│ └── grammar_patterns.json ← Grammar error patterns (NEW)
├── sessions/ ← {username}_sessions.json
├── memory/ ← {username}_memory.json
├── requirements.txt
└── README.md
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install packages
pip install -r requirements.txtstreamlit run app.py- Open the app in your browser (usually http://localhost:8501)
- Select "Coach" role
- Enter a coach username
- Explore the dashboard
- Open the app
- Select "Student" role
- Enter any username (creates account automatically)
- Select CEFR level (or let it auto-detect)
- Click "Get New Scenario"
- Record your response
- Review analysis and corrections
- Track progress over time
No API keys. No setup. Just speak and learn.
- Total students and sessions
- Average scores and WPM
- Most active student
- Highest scoring student
- Areas of opportunity (automatically identified)
- List of all students
- Session counts and progress
- Individual student details
- Error patterns per student
- Grammar errors across all students
- Missing connector types
- Common filler words
- Level distribution
- Score distribution histogram
- WPM vs Score scatter plot
- Progress trends
Edit data/scenario_library.json to add or modify scenarios:
{
"id": "b1_op_002",
"prompt": "Your scenario question here?",
"context": "Context for the student",
"target_structure": "Grammar focus",
"example_opener": "Suggested opening sentence",
"vocabulary_hints": ["word1", "word2", "word3"],
"evaluation_focus": "What to check for",
"duration_seconds": 60
}The rule-based correction engine detects:
| Pattern | Example Error | Correction |
|---|---|---|
| Third person -s | He go to work | He goes to work |
| Past simple regular | I walk yesterday | I walked yesterday |
| Past simple irregular | She taked the bus | She took the bus |
| Present perfect | I have saw it | I have seen it |
| Article usage | I am student | I am a student |
| Plural nouns | Two book | Two books |
| Subject-verb agreement | They goes | They go |
| Prepositions | In Monday | On Monday |
| Comparatives | More big | Bigger |
| Modals | I can to swim | I can swim |
| Questions | You are happy? | Are you happy? |
| Double negatives | I don't have nothing | I don't have anything |
- Open
data/scenario_library.json - Find the appropriate CEFR level (A1-C2)
- Find or create the scenario type
- Add a new scenario object following the existing format
- Open
data/grammar_patterns.json - Add a new pattern under
"patterns" - Add corresponding template under
"correction_templates"
- Push this repo to GitHub
- Go to share.streamlit.io
- Connect your repo
- Deploy
Note: On free tier, data resets on redeploy. For persistent storage:
- Use a database backend (SQLite, Supabase)
- Or export data regularly
streamlit run app.py --server.port 8501Every design decision maps to established SLA (Second Language Acquisition) research:
| Design Decision | Research Basis |
|---|---|
| Adaptive scenario difficulty | Krashen (1982) — Input Hypothesis (i+1) |
| Corrective feedback format | Long (1996) — Interaction Hypothesis |
| Explicit error marking | Schmidt (1990) — Noticing Hypothesis |
| Speaking-first practice | Swain (1985) — Output Hypothesis |
| CEFR level calibration | Council of Europe (2001) |
| Discourse connector training | Celce-Murcia et al. (2007) |
| Acoustic fluency metrics | Lennon (1990); Skehan (1996) |
| Error spaced repetition | Ebbinghaus (1885) — Forgetting Curve |
| Aspect | Original (Groq-based) | Improved (Rule-based) |
|---|---|---|
| Setup complexity | High (API keys needed) | None |
| Student onboarding | Complex | Instant |
| Scenario variety | Infinite (AI-generated) | Large library (50+ scenarios) |
| Correction depth | Deep (AI understands context) | Pattern-based (18 patterns) |
| Cost | API usage costs | Free |
| Offline capability | No | Yes |
| Coach insights | Limited | Comprehensive |
| Customization | Limited | Full control |
# Download manually
python -c "import whisper; whisper.load_model('tiny')"- Check browser microphone permissions
- Try the "Upload file" tab instead
- Ensure
sessions/andmemory/directories exist - Check write permissions
Possible improvements you could add:
- Database backend — Replace JSON files with SQLite/PostgreSQL
- More grammar patterns — Expand the rule-based engine
- Pronunciation feedback — Integrate phoneme-level analysis
- Mobile app — React Native wrapper
- Video scenarios — Add visual context
- Peer review — Students can review each other
- Gamification — Points, badges, leaderboards
MIT License — Free to use, modify, and distribute.
Built for English coaches who want a simple, effective tool for their students.
No API keys. No complexity. Just learning.