How gaviral/voice-text-ai-demo works
Main Components
• API Layer (FastAPI): Represented by “app.py,” this is where all HTTP endpoints are defined and routed.
• Core AI/ML Models/Modules:
• Speech Recognition: Using the Whisper model.
• Speaker Diarization: Hosted via PyAnnote.
• Text Translation: Using MarianMT (Helsinki-NLP).
• NLP Pipelines: For sentiment analysis, compliance detection, and semantic similarity (using Hugging Face Transformers and Sentence Transformers).
• External Dependencies: Include an external resource block (if applicable) for obtaining Hugging Face tokens (HF_AUTH_TOKEN) and any libraries installed via requirements.txt.
• Client/Consumer: Show that consumers of this service interact with the endpoints via HTTP (POST requests).
Relationships and Data Flow
• For speech transcription endpoints, illustrate the flow from the API to the Whisper model.
• For diarization, flow the request to PyAnnote.
• For text analysis endpoints, show the flow into the appropriate NLP processing modules.
• If combined pipelines are used, indicate a sequential flow where the result from one module (e.g., transcription) is fed into another module (e.g., sentiment analysis or compliance check).
Architectural Patterns & Design Principles
• Microservice Design: Although contained in a single container, the architecture logically separates functionalities into distinct processing modules.
• Containerization: Highlight that the entire service is deployed via Docker for consistent environments and scalability.
• Modularity: Emphasize the loosely-coupled design where each endpoint encapsulates a separate AI functionality, making the system easier to extend.
Technical Stack & Technologies
• FastAPI for the web framework.
• Docker for containerization.
• Libraries/Models: Whisper, PyAnnote, MarianMT, Hugging Face Transformers, and Sentence Transformers.
Additional Elements
• And label API endpoints (as listed in the README) so that interactions become clear.
• Annotations showing optional parameters (like threshold and max_results) for compliance detection.
• That the system leverages containerization by optionally depicting environment variables (e.g., HF_AUTH_TOKEN and LOW_MEMORY) which affect runtime behavior.