Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

babbelfish.ai

Overview

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.

Babbelfish demo gif

Features

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

Installation

Prerequisites

  • Python 3.11 or higher
  • Streamlit
  • Langflow
  • ElevenLabs.io API key
  • coloredlogs package

Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/babbelfish.ai.git
    cd babbelfish.ai
  2. Create a .env file in the root directory by copying the .env.example file and updating the environment variables:

    cp .env.example .env
  3. 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

Usage

  1. Run the Streamlit application:

    streamlit run babbelfish.py
  2. Open your web browser and navigate to http://localhost:8501.

  3. Use the sidebar to select the language you want to translate to and configure other settings.

  4. Type your message in the chat input or use the voice translation feature.

Langflow

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.

Logging

The application uses coloredlogs for logging. Logs are displayed in the terminal with different colors based on the log level.

File Structure

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

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Contact

For any questions or suggestions, please open an issue or contact the repository owner.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages