nima-azari/Dutch_Pron_Tool

0

stars

2

commits

Python

primary language

Jan 21, 2026

updated

README

Dutch Pronunciation Trainer πŸ‡³πŸ‡±

A Streamlit-based web application for A1-level Dutch learners to practice pronunciation with real-time AI feedback.

Features

  • 🎯 A1-Level Content: Practice sentences organized by topics (Greetings, Food, Shopping, etc.)
  • 🎧 Native Pronunciation: Listen to correct Dutch pronunciation via Google Text-to-Speech
  • 🎀 Voice Recording: Record yourself directly in the browser
  • πŸ€– AI Feedback: Get instant feedback using OpenAI Whisper speech recognition
  • 🎨 Visual Feedback: Color-coded word-by-word pronunciation analysis
  • πŸ“Š Accuracy Scores: Track your pronunciation accuracy percentage

Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)
  • FFmpeg (required by pydub for audio processing)

Install FFmpeg

macOS:

brew install ffmpeg

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

Windows: Download from ffmpeg.org and add to PATH.

Install Python Dependencies

pip install -r requirements.txt

Usage

  1. Start the application:

    streamlit run main.py
    
  2. Open your browser to the URL shown (usually http://localhost:8501)

  3. Practice:

    • Select a topic from the sidebar
    • Click "New Sentence" to get a random sentence
    • Listen to the correct pronunciation
    • Record yourself saying the sentence
    • Get instant feedback with accuracy score!

Project Structure

dutch-tutor/
β”œβ”€β”€ main.py                 # Streamlit entry point
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ arch.md                # Architecture documentation
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ audio_processor.py # Audio format conversion
β”‚   β”œβ”€β”€ tts_engine.py      # Text-to-Speech wrapper
β”‚   └── stt_engine.py      # Speech-to-Text wrapper
β”œβ”€β”€ logic/
β”‚   β”œβ”€β”€ scorer.py          # Pronunciation scoring logic
β”‚   └── sentences.py       # A1 practice sentences
└── assets/                # Temporary audio files

How It Works

  1. Text-to-Speech: Uses gTTS to generate Dutch pronunciation audio
  2. Speech Recognition: Whisper model transcribes your recording
  3. Comparison: Sequence matching algorithm compares your speech to the target
  4. Feedback: Color-coded results show:
    • 🟒 Green: Correct words
    • πŸ”΄ Red: Incorrect pronunciation
    • 🟑 Yellow: Missing words
    • 🟠 Orange: Extra words

Configuration

Whisper Model Size

By default, the app uses the base Whisper model. You can change this in utils/stt_engine.py:

  • tiny: Fastest, least accurate
  • base: Good balance (recommended)
  • small: More accurate, slower
  • medium or large: Most accurate, very slow

Fuzzy Matching Threshold

Adjust pronunciation tolerance in logic/scorer.py by changing fuzzy_threshold (default: 85).

Topics Available

  • Greetings
  • Introduction
  • Numbers (1-10)
  • Family
  • Food & Drink
  • Shopping
  • Directions
  • Weather
  • Colors
  • Days & Time

Troubleshooting

"No module named 'audio_recorder_streamlit'"

Install the audio recorder component:

pip install audio-recorder-streamlit

Whisper model download issues

The first time you run the app, Whisper will download the model (~140MB for base). Ensure you have a stable internet connection.

Audio recording not working

  • Make sure your browser has microphone permissions
  • Try Chrome or Firefox for best compatibility
  • Check that no other application is using the microphone

Contributing

Feel free to add more A1 sentences, improve the UI, or enhance the feedback algorithm!

License

MIT License - Feel free to use and modify for your learning needs.

Credits

  • OpenAI Whisper: Speech recognition
  • gTTS: Text-to-Speech
  • Streamlit: Web framework
  • RapidFuzz: Fuzzy string matching

Contributors

nima-azari

2 commits

nima-azari/Dutch_Pron_Tool

0

stars

2

commits

Python

primary language

Jan 21, 2026

updated

README

Dutch Pronunciation Trainer πŸ‡³πŸ‡±

A Streamlit-based web application for A1-level Dutch learners to practice pronunciation with real-time AI feedback.

Features

  • 🎯 A1-Level Content: Practice sentences organized by topics (Greetings, Food, Shopping, etc.)
  • 🎧 Native Pronunciation: Listen to correct Dutch pronunciation via Google Text-to-Speech
  • 🎀 Voice Recording: Record yourself directly in the browser
  • πŸ€– AI Feedback: Get instant feedback using OpenAI Whisper speech recognition
  • 🎨 Visual Feedback: Color-coded word-by-word pronunciation analysis
  • πŸ“Š Accuracy Scores: Track your pronunciation accuracy percentage

Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)
  • FFmpeg (required by pydub for audio processing)

Install FFmpeg

macOS:

brew install ffmpeg

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

Windows: Download from ffmpeg.org and add to PATH.

Install Python Dependencies

pip install -r requirements.txt

Usage

  1. Start the application:

    streamlit run main.py
    
  2. Open your browser to the URL shown (usually http://localhost:8501)

  3. Practice:

    • Select a topic from the sidebar
    • Click "New Sentence" to get a random sentence
    • Listen to the correct pronunciation
    • Record yourself saying the sentence
    • Get instant feedback with accuracy score!

Project Structure

dutch-tutor/
β”œβ”€β”€ main.py                 # Streamlit entry point
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ arch.md                # Architecture documentation
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ audio_processor.py # Audio format conversion
β”‚   β”œβ”€β”€ tts_engine.py      # Text-to-Speech wrapper
β”‚   └── stt_engine.py      # Speech-to-Text wrapper
β”œβ”€β”€ logic/
β”‚   β”œβ”€β”€ scorer.py          # Pronunciation scoring logic
β”‚   └── sentences.py       # A1 practice sentences
└── assets/                # Temporary audio files

How It Works

  1. Text-to-Speech: Uses gTTS to generate Dutch pronunciation audio
  2. Speech Recognition: Whisper model transcribes your recording
  3. Comparison: Sequence matching algorithm compares your speech to the target
  4. Feedback: Color-coded results show:
    • 🟒 Green: Correct words
    • πŸ”΄ Red: Incorrect pronunciation
    • 🟑 Yellow: Missing words
    • 🟠 Orange: Extra words

Configuration

Whisper Model Size

By default, the app uses the base Whisper model. You can change this in utils/stt_engine.py:

  • tiny: Fastest, least accurate
  • base: Good balance (recommended)
  • small: More accurate, slower
  • medium or large: Most accurate, very slow

Fuzzy Matching Threshold

Adjust pronunciation tolerance in logic/scorer.py by changing fuzzy_threshold (default: 85).

Topics Available

  • Greetings
  • Introduction
  • Numbers (1-10)
  • Family
  • Food & Drink
  • Shopping
  • Directions
  • Weather
  • Colors
  • Days & Time

Troubleshooting

"No module named 'audio_recorder_streamlit'"

Install the audio recorder component:

pip install audio-recorder-streamlit

Whisper model download issues

The first time you run the app, Whisper will download the model (~140MB for base). Ensure you have a stable internet connection.

Audio recording not working

  • Make sure your browser has microphone permissions
  • Try Chrome or Firefox for best compatibility
  • Check that no other application is using the microphone

Contributing

Feel free to add more A1 sentences, improve the UI, or enhance the feedback algorithm!

License

MIT License - Feel free to use and modify for your learning needs.

Credits

  • OpenAI Whisper: Speech recognition
  • gTTS: Text-to-Speech
  • Streamlit: Web framework
  • RapidFuzz: Fuzzy string matching

Contributors

nima-azari

2 commits

Languages

Python

95.1%

Shell

2.9%

Batchfile

2.0%