Spaces:
Sleeping
Sleeping
title: Speechtranslate | |
emoji: 🏆 | |
colorFrom: red | |
colorTo: yellow | |
sdk: gradio | |
sdk_version: 5.31.0 | |
app_file: app.py | |
pinned: false | |
license: apache-2.0 | |
short_description: text2speech+translate | |
# 🌐💬 Translate & Speak + Session Log | |
[](https://huggingface.co/spaces/your-username/translate-speak-log) | |
[](https://gradio.app) | |
[](https://www.python.org/) | |
[](LICENSE) | |
--- | |
## 🚀 Overview | |
Harness the power of **real-time NLP**, **on-the-fly translation**, and **neural TTS** in one elegant, CPU-only pipeline. This Space transforms user text into spoken audio—any English or Spanish input gets auto-detected, translated, and voiced back—while maintaining a live session log for data-driven insights. | |
**Key AI buzzwords:** | |
> Natural Language Processing (NLP) • Neural Text-to-Speech • Zero-shot language detection • Real-time inference • Session state management • Cloud-native deployment • User-centric design • Cost-efficient CPU runtime | |
--- | |
## ✨ Features | |
| 🔑 Feature | 🔍 Description | | |
|--------------------------------|-------------------------------------------------------------------------------------------------------------| | |
| **🔄 Bidirectional Translation** | English ↔ Spanish via `deep-translator`’s GoogleTranslator (auto-detect source language) | | |
| **🗣️ Neural TTS** | High-fidelity speech generation with `gTTS` (Google Translate TTS) | | |
| **🕒 Real-Time Processing** | Sub-second response on free CPU tier—no GPUs, no paid APIs | | |
| **📊 Session Logging** | Data-driven UX: every input, translation, and audio event recorded in an interactive DataFrame | | |
| **🎨 Interactive UI** | Sleek Gradio Blocks interface with controls for text input, language selector, and playback | | |
| **🔧 Zero-Config Dev** | Drop-in `app.py` + `requirements.txt`—Spaces auto-builds and deploys | | |
| **💡 Extensible Architecture** | Modular pipelines—swap translators, TTS engines, or add analytics with minimal code changes | | |
--- | |
## 🏗️ Architecture & Workflow | |
1. **User Input** | |
- Free-form text in any language (auto-detects English/Spanish). | |
2. **Translation** | |
- `deep-translator` → Google Translate API wrapper → high-accuracy text conversion. | |
3. **Text-to-Speech** | |
- `gTTS` → neural waveform synthesis → MP3 output. | |
4. **Session Log** | |
- Maintains a rolling table of `[Input, Target Language, Translated Text]` for audit trails and usage analytics. | |
5. **UI Rendering** | |
- Gradio Blocks orchestrates inputs, buttons, outputs, and state, delivering a seamless end-to-end experience. | |
--- | |
## 🛠️ Quick Start (Local Development) | |
```bash | |
git clone https://github.com/your-username/translate-speak-log.git | |
cd translate-speak-log | |
python3 -m venv venv && source venv/bin/activate | |
pip install -r requirements.txt | |
python app.py | |