Translation_with_T5 / Readme.md
rahimizadeh's picture
Update Readme.md
04ee352 verified
|
raw
history blame
1.63 kB

🌍 English-to-French Translation App

A Gradio web interface for translating English text to French using Hugging Face's T5 transformer models.

Encoder-Decoder Transformers (e.g., T5, BART, mT5) are comonly used for translation, summarization, question answering. They combine both encoder and decoder for input-output mappings.

Features

  • Model Selection: Choose between different T5 model sizes
    • t5-small: Faster inference
    • t5-base: Higher quality translations
  • Customizable Length: Control maximum translation output length
  • Example Texts: Try pre-loaded examples with one click
  • Responsive Design: Works on both desktop and mobile devices

How to Use

  1. Input Text:
    • Type or paste English text in the input box
  2. Select Model:
    • Choose your preferred balance of speed vs quality
  3. Adjust Length (Optional):
    • Use the slider to control translation length
  4. Click Translate:
    • Get instant French translation

Technical Details

Models Used

Dependencies

  • Transformers >=4.30.0
  • PyTorch >=1.10.0
  • Gradio >=3.40.0
  • SentencePiece (for tokenization)

Deployment

This app is designed for easy deployment on Hugging Face Spaces:

  1. Create a new Space
  2. Add these files:
    • app.py (main application)
    • requirements.txt (dependencies)
  3. The Space will automatically build and deploy

Local Development

To run locally:

pip install -r requirements.txt
python app.py