File size: 13,855 Bytes
cb974bb 321254f cb974bb eede3f3 cb974bb 321254f 3f792e8 3e27995 5e6e4ea 3e27995 5e6e4ea 3e27995 3f792e8 3e27995 321254f 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 5e6e4ea 3f792e8 3e27995 3f792e8 5e6e4ea 3f792e8 3e27995 3f792e8 5e6e4ea 3f792e8 5e6e4ea 3e27995 5e6e4ea 3f792e8 5e6e4ea 3f792e8 3e27995 3f792e8 8c5e398 3e27995 8c5e398 3e27995 3f792e8 3e27995 321254f 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 321254f 3f792e8 321254f 3e27995 321254f 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 321254f 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 3f792e8 3e27995 cb974bb 321254f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
---
title: Multilingual Audio Intelligence System
emoji: π΅
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
short_description: AI for multilingual transcription & Indian language support
---
# π΅ Multilingual Audio Intelligence System
<p align="center">
<img src="static/imgs/banner.png" alt="Multilingual Audio Intelligence System Banner" style="border: 1px solid black"/>
</p>
## Overview
This AI-powered platform combines speaker diarization, automatic speech recognition, and neural machine translation to deliver comprehensive audio analysis capabilities. The system includes support for multiple languages including Indian languages, with robust fallback strategies for reliable translation across diverse language pairs.
## Key Features
### **Multilingual Support**
- **Indian Languages**: Tamil, Hindi, Telugu, Gujarati, Kannada with dedicated optimization
- **Global Languages**: Support for 100+ languages through hybrid translation
- **Code-switching Detection**: Handles mixed language audio (Hindi-English, Tamil-English)
- **Language Identification**: Automatic detection with confidence scoring
### **3-Tier Translation System**
- **Tier 1**: Helsinki-NLP/Opus-MT models for supported language pairs
- **Tier 2**: Google Translate API alternatives for broad coverage
- **Tier 3**: mBART50 multilingual model for offline fallback
- **Automatic Fallback**: Seamless switching between translation methods
### **Audio Processing**
- **Large File Handling**: Automatic chunking for extended audio files
- **Memory Optimization**: Efficient processing for various system configurations
- **Format Support**: WAV, MP3, OGG, FLAC, M4A with automatic conversion
- **Quality Control**: Advanced filtering for repetitive and low-quality segments
### **User Interface**
- **Waveform Visualization**: Real-time audio frequency display
- **Interactive Demo Mode**: Pre-loaded sample files for testing
- **Progress Tracking**: Real-time processing status updates
- **Multi-format Export**: JSON, SRT, TXT, CSV output options
## Demo Mode
The system includes sample audio files for testing and demonstration:
- [Japanese Business Audio](https://www.mitsue.co.jp/service/audio_and_video/audio_production/media/narrators_sample/yuri_kizaki/03.mp3): Professional voice message about website communication
- [French Film Podcast](https://www.lightbulblanguages.co.uk/resources/audio/film-podcast.mp3): Discussion about movies including Social Network and Paranormal Activity
- [Tamil Wikipedia Interview](https://commons.wikimedia.org/wiki/File:Parvathisri-Wikipedia-Interview-Vanavil-fm.ogg): Tamil language interview on collaborative knowledge sharing (36+ minutes)
- [Hindi Car Trouble](https://www.tuttlepublishing.com/content/docs/9780804844383/06-18%20Part2%20Car%20Trouble.mp3): Hindi conversation about daily life scenarios (2:45)
### Demo Features
- **Pre-processed Results**: Cached processing for quick demonstration
- **Interactive Interface**: Audio preview with waveform visualization
- **Language Indicators**: Clear identification of source languages
- **Instant Access**: No waiting time for model loading
## Technical Implementation
### **Core Components**
- **Advanced Speaker Diarization**: pyannote.audio with enhanced speaker verification
- **Multilingual Speech Recognition**: faster-whisper with enhanced language detection
- **Neural Translation**: Multi-tier system with intelligent fallback strategies
- **Advanced Audio Processing**: Enhanced noise reduction with ML models and signal processing
### **Performance Features**
- **CPU-Optimized**: Designed for broad compatibility without GPU requirements
- **Memory Efficient**: Smart chunking and caching for large files
- **Batch Processing**: Optimized translation for multiple segments
- **Progressive Loading**: Smooth user experience during processing
## πΈ Screenshots
#### π¬ Demo Banner
<p align="center">
<img src="static/imgs/demo_mode_banner.png" alt="Demo Banner" style="border: 1px solid black"/>
</p>
#### π Transcript with Translation
<p align="center">
<img src="static/imgs/demo_res_transcript_translate.png" alt="Transcript with Translation" style="border: 1px solid black"/>
</p>
#### π Visual Representation
<p align="center">
<img src="static/imgs/demo_res_visual.png" alt="Visual Representation" style="border: 1px solid black"/>
</p>
#### π§ Summary Output
<p align="center">
<img src="static/imgs/demo_res_summary.png" alt="Summary Output" style="border: 1px solid black"/>
</p>
#### π¬ Full Processing Mode
<p align="center">
<img src="static/imgs/full_mode_banner.png" alt="Full Processing Mode" style="border: 1px solid black"/>
</p>
## π Quick Start
### **1. Environment Setup**
```bash
# Clone the enhanced repository
git clone https://github.com/Prathameshv07/Multilingual-Audio-Intelligence-System.git
cd Enhanced-Multilingual-Audio-Intelligence-System
# Create conda environment (recommended)
conda create --name audio_challenge python=3.9
conda activate audio_challenge
```
### **2. Install Dependencies**
```bash
# Install all requirements (includes new hybrid translation dependencies)
pip install -r requirements.txt
# Optional: Install additional Google Translate libraries for enhanced fallback
pip install googletrans==4.0.0rc1 deep-translator
```
### **3. Configure Environment**
```bash
# Copy environment template
cp config.example.env .env
# Edit .env file (HUGGINGFACE_TOKEN is optional but recommended)
# Note: Google API key is optional - system uses free alternatives by default
```
### **4. Run the Enhanced System**
```bash
# Start the web application
python run_app.py
# Or run in different modes
python run_app.py --mode web # Web interface (default)
python run_app.py --mode demo # Demo mode only
python run_app.py --mode cli # Command line interface
python run_app.py --mode test # System testing
```
## π Enhanced File Structure
```
Enhanced-Multilingual-Audio-Intelligence-System/
βββ run_app.py # Single entry point for all modes
βββ web_app.py # Enhanced FastAPI application
βββ src/ # Organized source modules
β βββ main.py # Enhanced pipeline orchestrator
β βββ audio_processor.py # Enhanced with smart file management
β βββ speaker_diarizer.py # pyannote.audio integration
β βββ speech_recognizer.py # faster-whisper integration
β βββ translator.py # 3-tier hybrid translation system
β βββ output_formatter.py # Multi-format output generation
β βββ demo_manager.py # Enhanced demo file management
β βββ ui_components.py # Interactive UI components
β βββ utils.py # Enhanced utility functions
βββ demo_audio/ # Enhanced demo files
β βββ Yuri_Kizaki.mp3 # Japanese business communication
β βββ Film_Podcast.mp3 # French cinema discussion
β βββ Tamil_Wikipedia_Interview.ogg # Tamil language interview
β βββ Car_Trouble.mp3 # Hindi daily conversation
βββ templates/
β βββ index.html # Enhanced UI with Indian language support
βββ static/
β βββ imgs/ # Enhanced screenshots and assets
βββ model_cache/ # Intelligent model caching
βββ outputs/ # Processing results
βββ requirements.txt # Enhanced dependencies
βββ README.md # This enhanced documentation
βββ DOCUMENTATION.md # Comprehensive technical docs
βββ TECHNICAL_UNDERSTANDING.md # System architecture guide
βββ files_which_are_not_needed/ # Archived legacy files
```
## π Enhanced Usage Examples
### **Web Interface (Recommended)**
```bash
python run_app.py
# Visit http://localhost:8000
# Try NEW Indian language demos!
```
### **Command Line Processing**
```bash
# Process with enhanced hybrid translation
python src/main.py audio.wav --translate-to en
# Process large files with smart chunking
python src/main.py large_audio.mp3 --output-dir results/
# Process Indian language audio
python src/main.py tamil_audio.wav --format json text srt
# Benchmark system performance
python src/main.py --benchmark test_audio.wav
```
### **API Integration**
```python
from src.main import AudioIntelligencePipeline
# Initialize with enhanced features
pipeline = AudioIntelligencePipeline(
whisper_model_size="small",
target_language="en",
device="cpu" # CPU-optimized for maximum compatibility
)
# Process with enhanced hybrid translation
results = pipeline.process_audio("your_audio_file.wav")
# Get comprehensive statistics
stats = pipeline.get_processing_stats()
translation_stats = pipeline.translator.get_translation_stats()
```
## π§ Advanced Configuration
### **Environment Variables**
```bash
# .env file configuration
HUGGINGFACE_TOKEN=your_token_here # Optional, for gated models
GOOGLE_API_KEY=your_key_here # Optional, uses free alternatives by default
OUTPUT_DIRECTORY=./enhanced_results # Custom output directory
LOG_LEVEL=INFO # Logging verbosity
ENABLE_GOOGLE_API=true # Enable hybrid translation tier 2
MAX_FILE_DURATION_MINUTES=60 # Smart file processing limit
MAX_FILE_SIZE_MB=200 # Smart file size limit
```
### **Model Configuration**
- **Whisper Models**: tiny, small (default), medium, large
- **Translation Tiers**: Configurable priority and fallback behavior
- **Device Selection**: CPU (recommended), CUDA (if available)
- **Cache Management**: Automatic model caching and cleanup
## System Advantages
### **Reliability**
- **Broad Compatibility**: CPU-optimized design works across different systems
- **Robust Translation**: Multi-tier fallback ensures translation coverage
- **Error Handling**: Graceful degradation and recovery mechanisms
- **File Processing**: Handles various audio formats and file sizes
### **User Experience**
- **Demo Mode**: Quick testing with pre-loaded sample files
- **Real-time Updates**: Live progress tracking during processing
- **Multiple Outputs**: JSON, SRT, TXT, CSV export formats
- **Interactive Interface**: Waveform visualization and audio preview
### **Performance**
- **Memory Efficient**: Optimized for resource-constrained environments
- **Batch Processing**: Efficient handling of multiple audio segments
- **Caching Strategy**: Intelligent model and result caching
- **Scalable Design**: Suitable for various deployment scenarios
## π Performance Metrics
### **Processing Speed**
- **Small Files** (< 5 min): ~30 seconds total processing
- **Medium Files** (5-30 min): ~2-5 minutes total processing
- **Large Files** (30+ min): Smart chunking with user warnings
### **Translation Accuracy**
- **Tier 1 (Opus-MT)**: 90-95% accuracy for supported language pairs
- **Tier 2 (Google API)**: 85-95% accuracy for broad language coverage
- **Tier 3 (mBART50)**: 75-90% accuracy for rare languages and code-switching
### **Language Support**
- **100+ Languages**: Through hybrid translation system
- **Indian Languages**: Tamil, Hindi, Telugu, Gujarati, Kannada, Malayalam, Bengali, Marathi, Punjabi, Urdu
- **Code-switching**: Mixed language detection and translation
- **Automatic Detection**: Language identification with confidence scores
## π¨ Waveform Visualization Features
### **Static Visualization**
- **Blue Bars**: Display audio frequency pattern when loaded
- **100 Bars**: Clean, readable visualization
- **Auto-Scaling**: Responsive to different screen sizes
### **Live Animation**
- **Green Bars**: Real-time frequency analysis during playback
- **Web Audio API**: Advanced audio processing capabilities
- **Fallback Protection**: Graceful degradation when Web Audio API unavailable
### **Technical Implementation**
- **HTML5 Canvas**: High-performance rendering
- **Event Listeners**: Automatic play/pause/ended detection
- **Memory Management**: Efficient animation frame handling
## π Deployment Options
### **Local Development**
```bash
python run_app.py
# Access at http://localhost:8000
```
### **Docker Deployment**
```bash
docker build -t audio-intelligence .
docker run -p 8000:7860 audio-intelligence
```
### **Hugging Face Spaces**
```yaml
# spaces.yaml
title: Multilingual Audio Intelligence System
emoji: π΅
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
```
## π€ Contributing
We welcome contributions to make this system even better for the competition:
1. **Indian Language Enhancements**: Additional regional language support
2. **Translation Improvements**: New tier implementations or fallback strategies
3. **UI/UX Improvements**: Enhanced visualizations and user interactions
4. **Performance Optimizations**: Speed and memory improvements
5. **Documentation**: Improved guides and examples
## π License
This enhanced system is released under MIT License - see the [LICENSE](LICENSE) file for details.
## π Acknowledgments
- **Original Audio Intelligence Team**: Foundation system architecture
- **Hugging Face**: Transformers and model hosting
- **Google**: Translation API alternatives
- **pyannote.audio**: Speaker diarization excellence
- **OpenAI**: faster-whisper optimization
- **Indian Language Community**: Testing and validation
---
**A comprehensive solution for multilingual audio analysis and translation, designed to handle diverse language requirements and processing scenarios.** |