|
Download README.md from neev2211/arabic-native-classifier: direct link, hf CLI and curl.
- Browser
- Download file 2.83 kB
-
https://huggingface.co/spaces/neev2211/arabic-native-classifier/resolve/main/README.md
- Command line
-
hf download hf://spaces/neev2211/arabic-native-classifier/README.md
-
curl -L -o README.md https://huggingface.co/spaces/neev2211/arabic-native-classifier/resolve/main/README.md
2.83 kB
| title: Arabic Nativity Classifier | |
| emoji: ποΈ | |
| colorFrom: indigo | |
| colorTo: purple | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| license: mit | |
| # Arabic Native vs Non-Native Speaker Detection | |
| **Wav2Vec2 XLS-R Prosody-Based Classification System** | |
| This application automatically classifies Arabic speakers as **Native** or **Non-Native** using advanced prosodic analysis with Meta's XLS-R multilingual speech model. | |
| ## β¨ Features | |
| - π€ **Multiple Input Modes** | |
| - Upload CSV with batch audio URLs | |
| - Custom CSV column mapping | |
| - Direct audio file upload (MP3, WAV, etc.) | |
| - Single URL classification | |
| - π§ **Advanced ML Pipeline** | |
| - Wav2Vec2 XLS-R (1.2B params) prosody layer extraction | |
| - 10-second audio chunking with overlap | |
| - Pitch, rhythm, and temporal variance features | |
| - MLP classifier with confidence scoring | |
| - Weighted chunk aggregation | |
| - π **Comprehensive Results** | |
| - Real-time processing progress | |
| - Per-sample predictions with confidence | |
| - Aggregate metrics (accuracy, F1, precision, recall) | |
| - Confusion matrix visualization | |
| - Chunk-level detail breakdown | |
| - π **Supported Arabic Dialects** | |
| - Saudi Arabian (Arabic_SA) | |
| - UAE (Arabic_AE) | |
| - Qatari (Arabic_QA) | |
| - Kuwaiti (Arabic_KW) | |
| ## π¬ Technical Details | |
| **Model Architecture:** | |
| - Encoder: `facebook/wav2vec2-large-xlsr-53` (XLS-R 300M) | |
| - Prosody layers: 4, 6, 8, 10 (early-to-mid) | |
| - Features: mean + std + F0 (pitch) β 2051-d embedding | |
| - Classifier: 3-layer MLP (384β256β128β2) | |
| - Threshold: 0.4 (optimized on validation) | |
| **Pipeline:** | |
| ``` | |
| Audio β Librosa 16kHz β 10s chunks β XLS-R layers β | |
| Prosody embedding β L2 norm β MLP β Confidence-weighted vote | |
| ``` | |
| ## π Usage | |
| 1. **CSV Upload**: Drag CSV with columns `audio_url`, `language` (optional `nativity_status` for metrics) | |
| 2. **Custom Mapping**: Upload any CSV and map columns via dropdowns | |
| 3. **Audio File**: Drop MP3/WAV and select language | |
| 4. **URL**: Paste direct audio link | |
| The system processes in real-time with visual progress updates. | |
| ## π Performance | |
| Validation metrics on Arabic dialect corpus: | |
| - **Accuracy**: 85.2% | |
| - **F1 Macro**: 84.7% | |
| - **Native F1**: 88.3% | |
| - **Non-Native F1**: 81.1% | |
| ## ποΈ Architecture | |
| Built with: | |
| - **Backend**: Flask + Gunicorn | |
| - **ML**: PyTorch + Transformers + Librosa | |
| - **Frontend**: Vanilla JS with Server-Sent Events | |
| - **Deployment**: Docker multi-stage build | |
| ## π― Use Cases | |
| - Language proficiency assessment | |
| - Call center accent analysis | |
| - Second language acquisition research | |
| - Speech therapy progress tracking | |
| - Dialect variation studies | |
| ## π Credits | |
| Developed for **Hackenza 2026** β Arabic Speech Processing Challenge | |
| Model: Meta AI XLS-R (Conneau et al., 2021) | |
| --- | |
| **Note**: First prediction may take ~30s as models load into memory. Subsequent requests are instant. | |