Babbelfish.ai is a Streamlit-based translation chatbot powered by Langflow. It allows users to translate text and speech into various languages, detect the language of the input, analyze sentiment, and provide explanations. The application also supports voice translation using ElevenLabs.io.
- Text Translation: Translate text into multiple languages.
- Voice Translation: Translate spoken words into different languages.
- Language Detection: Automatically detect the language of the input text.
- Sentiment Analysis: Analyze the sentiment of the input text.
- Explanations: Provide explanations for the detected sentiment.
- Voice Output: Use ElevenLabs.io for voice synthesis of the translated text.
- Python 3.11 or higher
- Streamlit
- Langflow
- ElevenLabs.io API key
coloredlogspackage
-
Clone the repository:
git clone https://github.com/yourusername/babbelfish.ai.git cd babbelfish.ai -
Create a
.envfile in the root directory by copying the.env.examplefile and updating the environment variables:cp .env.example .env
-
Install the required packages:
pip install -r requirements.txt && cd components && npm install --prefix elevenlabs_component/frontend && npm run build --prefix elevenlabs_component/frontend && npm install --prefix audio_component/frontend && npm run build --prefix audio_component/frontend
-
Run the Streamlit application:
streamlit run babbelfish.py
-
Open your web browser and navigate to
http://localhost:8501. -
Use the sidebar to select the language you want to translate to and configure other settings.
-
Type your message in the chat input or use the voice translation feature.
In order to fully run Babbelfish.ai, you will need to host Langflow. Langflow is a free, open source tool that allows you visually build Generative AI workflows. Once you have Langflow installed, download the included Babbelfish.ai.json file and upload it in your Langflow instance.
The application uses coloredlogs for logging. Logs are displayed in the terminal with different colors based on the log level.
babbelfish.py: Main application file.babbelfish_flow.py: Contains the LangflowRunner class for interacting with Langflow.listen_and_convert.py: Contains the TranscribeAudio class for handling audio transcription.components/: Contains Streamlit components for audio and ElevenLabs integration.static/: Contains static assets like images.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please open an issue or contact the repository owner.
