Skip to content

The Multilingual Translator is a real-time text translation tool built using Hugging Face’s Helsinki-NLP/opus-mt models. It supports multiple language pairs and provides instant translations via a responsive ReactJS frontend and a scalable Flask backend. Perfect for breaking language barriers in travel, education, business, and more!

License

Notifications You must be signed in to change notification settings

allanninal/multilingual-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Multilingual Translator

The Multilingual Translator leverages Hugging Face’s Helsinki-NLP/opus-mt models to translate text between multiple languages effortlessly. Built with a ReactJS (Vite) frontend and a Flask backend, this tool provides real-time translations through an interactive interface.


Features

  • Dynamic Language Support: Translate text between various language pairs using Hugging Face models.
  • Real-Time Results: Translations are generated instantly for a seamless user experience.
  • User-Friendly Interface: Built with ReactJS for responsive and intuitive interaction.
  • Customizable: Open-source and extendable for specific needs or additional features.

Tech Stack

Frontend

  • ReactJS with Vite for a fast and responsive UI.
  • Axios for API communication.

Backend

  • Flask for handling API requests and processing translations.
  • Hugging Face’s Helsinki-NLP/opus-mt for accurate multilingual translation.

Installation and Setup

1. Clone the Repository

git clone [email protected]:allanninal/multilingual-translator.git
cd multilingual-translator

2. Backend Setup

  1. Create and activate a virtual environment:

    python3.12 -m venv venv
    source venv/bin/activate  # Linux/Mac
    venv\Scripts\activate     # Windows
  2. Install dependencies using requirements.txt from the backend folder:

    pip install -r backend/requirements.txt
  3. Run the Flask backend:

    python backend/app.py

3. Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the React development server:

    npm run dev

Visit the app at http://localhost:5173.


How It Works

  1. Input Text: Enter the text and specify the source and target languages.
  2. Backend Processing: Flask processes the input and uses Hugging Face’s Helsinki-NLP/opus-mt models for translation.
  3. Display Results: The frontend displays the translated text in real-time.

Future Enhancements

  1. Speech Integration: Add text-to-speech and speech-to-text capabilities for audio translations.
  2. Language Dropdowns: Replace text input fields with dropdown menus for easy language selection.
  3. Save Translations: Allow users to save translated text locally or in the cloud.
  4. Enhanced UI/UX: Add progress indicators and polished designs for better user experience.
  5. Offline Support: Enable limited offline translations by hosting specific language models locally.

License

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


Support

If you find this project helpful, consider supporting me on Ko-fi:
ko-fi.com/allanninal


Explore More Projects

For more exciting projects, check out my list of AI Mini Projects:
Mini AI Projects GitHub List

About

The Multilingual Translator is a real-time text translation tool built using Hugging Face’s Helsinki-NLP/opus-mt models. It supports multiple language pairs and provides instant translations via a responsive ReactJS frontend and a scalable Flask backend. Perfect for breaking language barriers in travel, education, business, and more!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published