CoolFace
Apppublic

juliensimon/voice-queries

sourceHugging Faceupdated 4mo agoView on Hugging Face
7likes
App README

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

  1. 1.Choose text or speech input mode
  2. 2.Type a query in English or record a voice query in any of 21 supported languages
  3. 3.Set the number of results (1–10)
  4. 4.Get matching sentences from corporate 10-K filings ranked by semantic similarity

Models

ModelPurpose
sentence-transformers/msmarco-distilbert-base-v4Semantic embedding and similarity search
facebook/wav2vec2-xls-r-300m-21-to-enMultilingual speech recognition (21 languages → English)

Pipeline

Voice (21 languages) → wav2vec2-xls-r → English text → Sentence embedding → Semantic search → Ranked results

Dataset

  • 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 .npz format 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

bash
git clone https://huggingface.co/spaces/juliensimon/voice-queries
cd voice-queries
pip install -r requirements.txt
python app.py
Note: The dataset files (df10k_SP500_2020.csv.zip and the embeddings .npz file) total ~660 MB and will be downloaded with the repo.