You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A complete AI-powered British English accent training platform with real-time WebSocket monitoring, adaptive course engine, intelligent LLM tutor, and modern analytics dashboard.
The AI Accent Builder follows a complete end-to-end pipeline designed to help non-native speakers develop a natural British English accent through analysis, comparison, and feedback. The process begins when the user records their voice through a microphone using a React-based web interface or a Flutter mobile application. The recorded audio is saved in WebM format and converted to a 16kHz mono WAV file using pydub for consistent processing. This audio is then passed to a speech-to-text module, where Vosk is used as the primary offline ASR engine and Whisper is used as a fallback to improve accuracy. The speech-to-text process produces both the transcribed text and word-level timestamps.
Using the transcribed text, a British English reference speech sample is generated through pyttsx3 text-to-speech, which represents a correct native British accent. Both the user's speech and the reference British speech are analysed in parallel. Acoustic and accent-related features are extracted using librosa and parselmouth (Praat), including pitch (F0), stress intensity, rhythm, intonation patterns, speaking rate, pause duration, MFCCs, and vowel formants (F1, F2, F3). To achieve precise word and phoneme alignment, forced alignment is applied using Vosk timestamps combined with g2p_en phoneme mapping.
Accent comparison is then performed using multiple techniques: Dynamic Time Warping (fastdtw) aligns pitch, MFCC, and energy features spoken at different speeds; Pearson correlation measures similarity in pitch and energy contours; ratio-based timing analysis evaluates rhythm and stress balance; and Levenshtein edit distance detects pronunciation and phoneme-level deviations. In addition, a custom PyTorch-based pronunciation scoring model trained on the SpeechOcean762 dataset predicts pronunciation quality across accuracy, fluency, completeness, prosody, and overall score.
These results are combined using a weighted scoring system that evaluates phoneme accuracy, pitch similarity, timing, stress, vowel quality, and fluency to produce detailed accent scores at sentence, word, and phoneme levels. The feedback is presented visually and audibly through the frontend, where incorrect words and phonemes are highlighted, correct British accent segments are playable, and simple improvement tips are shown. The entire recording and practice experience uses WebSocket connections that process speech in real time — words appear as you speak, phonemes are colour-coded live, and the AI tutor responds instantly, giving the natural feel of talking to a real person rather than waiting for a delayed result. To support natural conversation practice, the transcribed text is also processed through British English grammar and vocabulary modules using LanguageTool, FLAN-T5, and spaCy. The system features an intelligent AI tutor powered by Mistral LLM (open-source, self-hosted) as the primary model for fast, private, zero-cost inference; if the system does not support Mistral, the tutor automatically falls back to Google Gemini API (gemini-2.5-flash) to ensure it is always available regardless of hardware. The platform also includes a smart monitoring dashboard with real-time Chart.js analytics, and an adaptive course engine that continuously analyses user reports and mistakes to automatically update courses and practice content — no two users see the same exercises. Each user receives a personalised learning roadmap that auto-generates weekly milestones, identifies weak areas, schedules targeted drills for specific phonemes and metrics, and updates itself after every session based on the latest scores. All scores, sessions, and progress data are stored through a FastAPI backend with SQLite, ultimately helping users gradually adopt authentic British English accent patterns through personalised, data-driven learning.
Feature
Description
Shadowing Practice
Listen to native British audio, record your speech, and get scored across 6 metrics
Real-Time WebSocket Feedback
Live phoneme-by-phoneme feedback with < 500ms latency via persistent WebSocket connections
Hybrid Scoring
Combines rule-based, signal-processing, and ML approaches for accurate assessment
Grammar Checking
British English grammar correction with LanguageTool + FLAN-T5
AI Tutor (Gemini LLM)
A real AI tutor that analyses your mistakes, explains how to improve, gives tips, and asks follow-up questions
Adaptive Course Engine
Dynamically updates course content based on your weak areas and skill level
Smart Monitoring Dashboard
Modern Chart.js-powered analytics with real-time performance tracking
Progress Tracking
Long-term session history, improvement trends, and streak tracking
PDF Reports
Downloadable assessment reports with charts and detailed scores
A modern, visually rich dashboard that monitors every aspect of the user's learning journey in real time:
Live Performance Charts — Interactive line, bar, doughnut, and radar charts powered by showing scores over time, metric breakdowns, and session comparisons
Collapsible Sidebar Navigation — Quick access to all modules with badge indicators for pending tasks
Stats Grid — At-a-glance cards displaying overall score, total sessions, current streak, accuracy rate, and time practised
Module Progress Cards — Visual progress bars for each learning module (Shadowing, Pronunciation, Grammar, Conversation)
Session Timeline — Chronological view of all practice sessions with per-session scores
Responsive Layout — Fully adaptive from desktop (4-column charts) to tablet (2-column) to mobile (stacked)
Smooth Animations — Micro-interactions, hover effects, and transition animations for a premium feel
Dark / Light Theme - variable-based theming defined in index.css
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#4361EE', 'primaryBorderColor': '#357ABD', 'primaryTextColor': '#ffffff', 'lineColor': '#4A90E2', 'secondaryColor': '#F72585', 'tertiaryColor': '#4CC9F0'}}}%%
flowchart LR
A["🎤 User Audio"] --> B["🔌 WebSocket"]
B --> C["🔇 Noise Reduction"]
C --> D["🗣️ Vosk / Whisper STT"]
D --> E["🔤 g2p_en Phonemes"]
E --> F["📊 Feature Extraction"]
F --> G["🧠 PyTorch Scorer"]
G --> H{"Score > 70?"}
H -->|Yes| I["✅ Pass — Next Level"]
H -->|No| J["🔄 Targeted Drills"]
G --> K["🤖 Mistral / Gemini LLM"]
K --> L["💬 Real-time Feedback"]
L --> M["📱 React / Flutter UI"]
style A fill:#4361EE,stroke:#357ABD,color:#fff
style B fill:#FF9E00,stroke:#e68a00,color:#fff
style C fill:#4CC9F0,stroke:#00B4D8,color:#fff
style D fill:#7209B7,stroke:#5a0791,color:#fff
style E fill:#F72585,stroke:#d41e6e,color:#fff
style F fill:#00B4D8,stroke:#009bb8,color:#fff
style G fill:#4361EE,stroke:#357ABD,color:#fff
style H fill:#FFD60A,stroke:#e6c009,color:#2C3E50
style I fill:#2ECC71,stroke:#27AE60,color:#fff
style J fill:#E74C3C,stroke:#C0392B,color:#fff
style K fill:#FF9E00,stroke:#e68a00,color:#fff
style L fill:#F72585,stroke:#d41e6e,color:#fff
style M fill:#4A90E2,stroke:#357ABD,color:#fff
Loading
— Talk Like a Real Person
The platform uses persistent WebSocket connections for all real-time features. During recording, the system processes your speech live and responds instantly — giving you the natural, conversational feel of talking to a real person, not waiting for a delayed batch result.
How it feels:
You speak → words appear in real time → phoneme colours update live → the AI tutor responds immediately — just like having a real British English teacher sitting next to you.
Client (React / Flutter) Server (FastAPI)
│ │
│ ──── ws://localhost:8000/ws/pronunciation ─►│ ← Connection opened
│ │
│ ──── Send target text ─────────────────► │
│ │
│ ──── Stream audio chunks (16kHz) ──────► │ ← Process each chunk
│ │
│ ◄──── Live transcription ─────────────── │ ← Words appear as you speak
│ ◄──── Phoneme update (every ~500ms) ──── │ ← Colour-coded right/wrong
│ ◄──── Prosody score update ────────────── │ ← librosa + PyTorch
│ ◄──── Live metric bars ────────────────── │ ← Real-time UI update
│ ◄──── AI tutor response (streamed) ────── │ ← Instant conversational reply
│ │
│ ──── Stop signal ──────────────────────► │
│ ◄──── Final assessment JSON ───────────── │
│ │
WebSocket Endpoints:
Endpoint
Purpose
Data Flow
/ws/pronunciation
Real-time phoneme feedback during recording
Audio chunks → live phoneme + prosody updates
/ws/transcribe
Live transcription — words appear as you speak
Audio chunks → partial text in real time
/ws/tutor
AI tutor conversation — instant replies like a real person
User message → streamed LLM response
— Mistral LLM + Gemini Fallback
The platform features an intelligent AI tutor that acts as a real British English teacher, powered by a dual-LLM strategy:
Courses and practice content change automatically — the system continuously analyses your reports and mistakes, then updates what you see next. No two users get the same experience.
Feature
Description
Skill-Level Detection
Automatically classifies user as Beginner / Intermediate / Advanced based on cumulative scores
Weak-Area Identification
Analyses the 6 accent metrics to find your weakest areas (e.g., low pitch similarity → more intonation drills)
Auto Content Updates
Practice sentences, exercises, and course modules change automatically after each session based on your latest report
Progressive Difficulty
Gradually increases sentence length, speed, and complexity as you improve
Mistake-Based Drills
If you consistently mispronounce certain phonemes (e.g., /θ/ → /t/), the system creates targeted drills automatically
Course Modules
Structured modules for Intonation, Stress, Vowels, Connected Speech, and Conversation