Text Translation Web Application

This Python script creates a web-based text translation application using the Gradio library and the Hugging Face Transformers library. The application allows users to translate text from one language to another using the mBART translation model.

app

Features

  • Translate text from a source language to a target language.
  • Supports multiple source and target languages.
  • Provides instant translation results.

Usage

  1. Run the script: Execute the script to launch the translation web application.

  2. Select source and target languages: Choose the source and target languages from the dropdown menus. Supported languages include "ar" (Arabic), "en" (English), "fr" (French), "de" (German), "es" (Spanish), "zh" (Chinese), and "ja" (Japanese).

  3. Enter text to translate: In the "Enter Text to Translate" textbox, input the text you want to translate.

  4. Get translation: Click the "Translate" button to initiate the translation process.

  5. View the translation result: The translated text will be displayed in the "Translation Result" textbox.