Spaces:
Sleeping
Sleeping
File size: 5,095 Bytes
eee15d4 8ef276c eee15d4 8ef276c eee15d4 8ef276c e459b45 8ef276c |
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 |
---
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
|