A tool for analyzing English accents from video URLs for hiring purposes.
- Accept a video URL (YouTube, Loom, or direct MP4 link)
- Extract audio from the video
- Detect if the speech is in English
- Classify the speaker's accent
- Provide a confidence score
- Generate an explanation of the analysis
- Python 3.8 or higher (tested with Python 3.9-3.12)
- FFmpeg (required for audio extraction)
- Internet connection (for downloading videos and ML models)
FFmpeg is essential for audio extraction. Choose one method:
Option A - Using Conda (Recommended):
conda install ffmpegOption B - Manual Installation:
- Download FFmpeg from: https://www.gyan.dev/ffmpeg/builds/
- Download "release builds" → "ffmpeg-release-essentials.zip"
- Extract to
C:\ffmpeg - Add
C:\ffmpeg\binto your Windows PATH:- Press
Win+R, typesysdm.cpl - Go to "Advanced" → "Environment Variables"
- Under "System Variables", find "Path" and click "Edit"
- Click "New" and add
C:\ffmpeg\bin - Click OK and restart your terminal/VS Code
- Press
Option C - Using Chocolatey:
choco install ffmpegbrew install ffmpegsudo apt-get update
sudo apt-get install ffmpegffmpeg -versionYou should see version information if installed correctly.
pip install -r requirements.txt# Core dependencies
pip install streamlit>=1.32.0
pip install numpy>=1.26.0
pip install librosa>=0.10.1
pip install torch>=2.1.0
pip install transformers>=4.35.0
pip install pydub>=0.25.1
pip install requests>=2.31.0
pip install soundfile>=0.12.1
pip install yt-dlp>=2023.12.30
pip install ffmpeg-python>=0.2.0# Create virtual environment
python -m venv accent-analyzer-env
# Activate virtual environment
# Windows:
accent-analyzer-env\Scripts\activate
# macOS/Linux:
source accent-analyzer-env/bin/activate
# Upgrade pip and install dependencies
pip install --upgrade pip setuptools wheel
pip install -r requirements.txtTest that all components work:
# Test Python imports
python -c "import streamlit; print('✓ Streamlit installed')"
python -c "import librosa; print('✓ Librosa installed')"
python -c "import torch; print('✓ PyTorch installed')"
python -c "import yt_dlp; print('✓ yt-dlp installed')"
# Test FFmpeg
ffmpeg -versionstreamlit run app.pyThe app will open in your browser at http://localhost:8501
- Fork this repository to your GitHub account
- Go to Streamlit Cloud
- Sign in with your GitHub account
- Deploy the app by selecting this repository
- The app will be deployed at a public URL
# Build the Docker image
docker build -t accent-analyzer .
# Run the container
docker run -p 8501:8501 accent-analyzer- Install Heroku CLI
- Create a
Procfilewith:web: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0 - Deploy:
heroku create your-app-name
git push heroku main- Start the application using one of the methods above
- Enter a video URL in the input field:
- YouTube:
https://www.youtube.com/watch?v=VIDEO_ID - Loom:
https://www.loom.com/share/VIDEO_ID - Direct MP4: Any direct link to an MP4 file
- YouTube:
- Click "Analyze Accent"
- Wait for processing (may take 30-60 seconds for longer videos)
- View results including accent classification, confidence score, and explanation
- YouTube (public videos only)
- Loom (public recordings)
- Direct video links (.mp4, .avi, .mov, .mkv)
- Other platforms that provide direct video URLs
- Ensure FFmpeg is installed and in your PATH
- Restart your terminal/IDE after installation
- Try running
ffmpeg -versionto verify
- Ensure the video is public and accessible
- Some videos may be region-restricted
- Try with a different video URL
- Update pip:
pip install --upgrade pip - Use a virtual environment
- Install packages individually if bulk installation fails
- Ensure all dependencies are installed
- Check if you're using the correct Python environment
- Reinstall requirements:
pip install -r requirements.txt --force-reinstall
- Shorter videos process faster (under 5 minutes recommended)
- Good audio quality improves accent detection accuracy
- Clear speech without background music works best
- Single speaker videos give more accurate results
- Video Download: Uses
yt-dlpfor YouTube or direct download for other URLs - Audio Extraction: FFmpeg extracts audio track from video
- Audio Processing: Librosa processes audio and extracts acoustic features
- Speech Recognition: Transcribes audio to text (framework ready for Whisper integration)
- Language Detection: Confirms the speech is in English
- Accent Analysis: Classifies accent based on acoustic features
- Result Generation: Returns accent type, confidence score, and explanation
- Frontend: Streamlit (Python web framework)
- Audio Processing: FFmpeg, Librosa, PyDub
- Video Download: yt-dlp (YouTube), requests (direct URLs)
- Machine Learning: PyTorch, Transformers
- Deployment: Docker, Streamlit Cloud, Heroku
- Simulated accent detection: Current implementation uses feature-based classification
- Speech recognition: Uses placeholder for transcription (ready for Whisper integration)
- Processing time: Large videos may take several minutes
- Audio quality dependency: Poor audio quality affects accuracy
- Single speaker optimization: Works best with one primary speaker
- Enhanced Accent Detection: Replace simulation with trained accent classification model
- Improved Speech Recognition: Integrate OpenAI Whisper or similar model
- Real-time Processing: Add streaming audio processing capabilities
- Batch Processing: Support multiple video analysis
- API Integration: Create REST API for HR system integration
- Advanced Analytics: Detailed accent characteristic breakdown
- Database Storage: Store analysis results and user sessions
This tool is designed as a preliminary screening aid and should be used responsibly:
- Not a sole decision factor: Use alongside human evaluation
- Bias awareness: Be conscious of potential algorithmic biases
- Privacy protection: Ensure candidate data is handled securely
- Legal compliance: Follow local hiring and discrimination laws
- Transparency: Inform candidates about automated screening tools
MIT License - feel free to modify and distribute.
For issues or questions:
- Check the troubleshooting section above
- Ensure all prerequisites are properly installed
- Test with a simple, short video first
- Create an issue on the repository for bug reports