This project is a multi-language translator and speech recognizer application built with Streamlit. The application allows users to upload audio or video files, transcribe the speech to text, and translate the transcribed text into multiple languages.
- Speech to Text: Transcribes audio from
.wav
and.mp4
files. - Multi-Language Translation: Translates text between multiple languages.
- User-Friendly Interface: Built with Streamlit for a simple and interactive user experience.
- Speech to Text: The Google Web Speech API is used for converting speech to text. It is known for its accuracy and extensive language support.
- Translation: The
Helsinki-NLP/opus-mt-multi
model from Hugging Face's Transformers library is used. This model is chosen for its ability to handle multiple language pairs effectively, providing high-quality translations across many languages.
The Helsinki-NLP/opus-mt-multi
model is a robust and versatile translation model that supports a wide range of language pairs. It is built on the MarianMT architecture, which is optimized for efficient translation with high accuracy. This model is particularly suitable for applications requiring translation between less commonly paired languages, making it ideal for this multi-language translator project.
The project supports translation between the following languages:
- English (en)
- French (fr)
- German (de)
- Spanish (es)
We use the Google Web Speech API for the speech to text conversion. This API is chosen due to its high accuracy, ease of use, and support for a wide range of languages.
You can view a video demonstration of the project
streamlit-app-2024-06-03-20-06-96.mp4
- Python 3.7+
git
installed on your machineffmpeg
installed on your machine
-
Clone the Repository
git clone <https://github.com/vibhorjoshi/multi_language_app/edit/main> cd multi_language_app
-
Create and Activate a Virtual Environment
On macOS/Linux:
python3 -m venv venv source venv/bin/activate
On Windows:
python -m venv venv venv\Scripts\activate
-
Install the Dependencies
pip install -r requirements.txt
-
Install
ffmpeg
On Ubuntu/Debian:
sudo apt-get update sudo apt-get install ffmpeg
On macOS (with Homebrew):
brew install ffmpeg
On Windows:
- Download
ffmpeg
from the official website. - Follow the instructions to add
ffmpeg
to your system's PATH.
- Download
-
Run the Streamlit App
streamlit run app.py
multi_language_app/
│ ├── app.py
├── translator.py
├── speech_recog.py
├── requirements.txt
├── venv/ # Virtual environment directory │ └── audio/ # Directory to store audio files for speech recognition
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
You can access the deployed version of this application here.