Muhammed Essam
Switch to Whisper base
e459b45
---
title: Voice Assistant - Multi-language Division Matching & Contact Search
emoji: πŸŽ™οΈ
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 4.0.0
app_file: app.py
pinned: false
license: mit
---
# πŸŽ™οΈ Voice Assistant Demo
A powerful multi-language voice assistant that helps users find divisions and contacts within an organization using natural language queries.
## 🌟 Features
### πŸ—£οΈ Multi-language Voice Input
- **99+ languages** supported (auto-detected)
- Automatic speech-to-text using OpenAI Whisper
- Arabic-to-English translation for seamless processing
- Works with various audio formats
### 🎯 Smart Division Matching
- Semantic search using sentence embeddings
- Confidence-based routing with intelligent thresholds
- Department-level expansion (searches all divisions in a department)
- Fast matching (~50ms) using `all-MiniLM-L6-v2`
### πŸ‘€ Name Extraction
- Extracts person names from queries using GLiNER
- Supports English and Arabic names
- Zero-shot NER for robust extraction
### πŸ“ž Contact Search
- 500+ contacts across 23 departments and 67 divisions
- Intelligent matching combining name and division
- Confidence scoring with match reasoning
- Fuzzy name matching for typos and variations
## πŸš€ How to Use
### Division Matching (Text)
Find the right division for your query:
```
"I need help from IT Security"
"Find someone in Finance"
"Connect me to Human Resources"
```
### Division Matching (Voice)
Speak your query in any language - it will be transcribed and processed automatically.
### Contact Search (Text)
Search for specific people or teams:
```
"Find Dima in Information Technology"
"Ahmed Al-Malek"
"I need to talk to someone in Legal"
```
### Contact Search (Voice)
Speak your contact search query in any language.
## πŸ“Š Example Queries
### Department-Level Queries
These queries search across ALL divisions in a department:
- βœ… "Find someone in Information Technology" β†’ Searches 8 IT divisions
- βœ… "I need help from Finance" β†’ Searches all Finance divisions
- βœ… "Connect me to Human Resources" β†’ Searches all HR divisions
### Division-Level Queries
These match specific divisions:
- βœ… "Find Ahmed in App Dev" β†’ Applications Development & Integrations
- βœ… "I need help from IT Security" β†’ IT Security Implementation & Operations
- βœ… "Connect me to Legal" β†’ Legal divisions
### Name-Only Queries
- βœ… "Find Dima" β†’ Searches all contacts named Dima
- βœ… "Ahmed Al-Malek" β†’ Exact name match
- βœ… "I need to talk to Rashed" β†’ Fuzzy name matching
### Combined Queries (Name + Department/Division)
Priority given to division accuracy:
- βœ… "Find Dima in Information Technology" β†’ Perfect match (confidence: 1.00)
- βœ… "Find Ahmed in App Dev" β†’ Shows App Dev team members
## πŸ”§ Technical Details
### Models Used
- **Embeddings**: `sentence-transformers/all-MiniLM-L6-v2` - Fast, lightweight semantic search
- **Name Extraction**: `urchade/gliner_small-v2.1` - Zero-shot NER for person names
- **Speech-to-Text**: `openai/whisper-base` - Optimized for CPU with good accuracy
### Confidence Scoring
| Score | Meaning | Example |
|-------|---------|---------|
| **1.00** | Perfect match (name + division) | Dima in IT |
| **0.95** | Exact name match | Ahmed Al-Malek |
| **0.66** | Strong division match | People in requested division |
| **0.59** | Good division match | Close division match |
| **< 0.30** | Low confidence | Wrong division penalty |
### Match Reasons
- `name_and_division_match` - Both name AND division match βœ…
- `division_match` - Division/department matches (no name match)
- `exact_name_match` - Exact name match (100%)
- `fuzzy_name_match` - Partial name match (75%+)
- `name_match_wrong_division` - Name matches but WRONG division ⚠️
## πŸ“¦ Database Stats
- **500 contacts** across the organization
- **23 departments** (Information Technology, Finance, HR, etc.)
- **67 divisions** (specific teams and units)
- **Multi-language support** (English + Arabic names)
## 🌍 Supported Languages
The voice assistant supports **99+ languages** including:
- English
- Arabic (Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©)
- Spanish, French, German, Italian
- Chinese (δΈ­ζ–‡), Japanese (ζ—₯本θͺž), Korean (ν•œκ΅­μ–΄)
- Hindi, Urdu, Bengali
- And many more...
Language is automatically detected - just speak naturally!
## ⚑ Performance
- **Division Matching**: ~50ms per query
- **Name Extraction**: ~100-200ms per query
- **Voice Processing**: ~1-3 seconds (depends on audio length)
- **Contact Search**: ~100-300ms per query
## πŸ› οΈ Built With
- **Gradio** - Interactive web interface
- **FastAPI** - Backend API (original implementation)
- **Sentence Transformers** - Semantic search
- **OpenAI Whisper** - Speech recognition
- **GLiNER** - Named Entity Recognition
- **PyTorch** - Deep learning framework
## πŸ“ License
MIT License
## πŸ™ Acknowledgments
- OpenAI for Whisper
- Hugging Face for model hosting
- URCHADE for GLiNER
- Sentence Transformers team
---
**Version:** 4.0.0
**Status:** βœ… Production Ready
**Demo Type:** Interactive Gradio Demo