juliensimon/voice-queries
7
Voice Queries on Financial Documents
Search S&P 500 annual filings (10-K forms) using text or voice queries in 21 languages. Combines multilingual speech recognition with semantic search over corporate financial disclosures.
<p align="center"> <img src="https://img.shields.io/badge/Languages-21-blue" alt="21 Languages"> <img src="https://img.shields.io/badge/Corpus-S%26P%20500%20(2020)-green" alt="S&P 500"> <img src="https://img.shields.io/badge/Search-Semantic-purple" alt="Semantic Search"> <img src="https://img.shields.io/badge/SDK-Gradio-orange" alt="Gradio"> </p>
How It Works
- Choose text or speech input mode
- Type a query in English or record a voice query in any of 21 supported languages
- Set the number of results (1–10)
- Get matching sentences from corporate 10-K filings ranked by semantic similarity
Models
Pipeline
Voice (21 languages) → wav2vec2-xls-r → English text → Sentence embedding → Semantic search → Ranked resultsDataset
- Corpus: Management Discussion & Analysis (MD&A) sections from 2020 annual filings of all S&P 500 companies
- Pre-computed embeddings: ~500K sentence embeddings stored in
.npzformat for instant search - Results include: Company ticker, form type, filing date, matching text, and relevance score
Example Queries
Pre-recorded voice examples in French, Spanish, and German:
- 🇫🇷 "Nos ventes internationales ont significativement augmenté"
- 🇫🇷 "Le prix de l'énergie pourrait avoir un impact négatif dans le futur"
- 🇪🇸 "El precio de la energía podría tener un impacto negativo en el futuro"
- 🇩🇪 "Mehrere Steuerbehörden untersuchen unser Unternehmen"
Tech Stack
- Sentence Transformers: Semantic embedding and similarity search
- Transformers: wav2vec2 automatic speech recognition
- Librosa: Audio loading and resampling
- NLTK: Sentence tokenization of the 10-K corpus
- Gradio: Interactive web interface
Run Locally
git clone https://huggingface.co/spaces/juliensimon/voice-queries
cd voice-queries
pip install -r requirements.txt
python app.pyNote: The dataset files (df10k_SP500_2020.csv.zipand the embeddings.npzfile) total ~660 MB and will be downloaded with the repo.
