Spaces:
Sleeping
Sleeping
Create README.md
Browse files
README.md
CHANGED
@@ -1,14 +1,56 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 🌍 English-to-French Translation App
|
2 |
+
|
3 |
+
A Gradio web interface for translating English text to French using Hugging Face's T5 transformer models.
|
4 |
+
|
5 |
+
Encoder-Decoder Transformers (e.g., T5, BART, mT5) are comonly used for translation, summarization, question answering.
|
6 |
+
They combine both encoder and decoder for input-output mappings.
|
7 |
+
|
8 |
+
|
9 |
+
## Features
|
10 |
+
|
11 |
+
- **Model Selection**: Choose between different T5 model sizes
|
12 |
+
- `t5-small`: Faster inference
|
13 |
+
- `t5-base`: Higher quality translations
|
14 |
+
- **Customizable Length**: Control maximum translation output length
|
15 |
+
- **Example Texts**: Try pre-loaded examples with one click
|
16 |
+
- **Responsive Design**: Works on both desktop and mobile devices
|
17 |
+
|
18 |
+
## How to Use
|
19 |
+
|
20 |
+
1. **Input Text**:
|
21 |
+
- Type or paste English text in the input box
|
22 |
+
2. **Select Model**:
|
23 |
+
- Choose your preferred balance of speed vs quality
|
24 |
+
3. **Adjust Length** (Optional):
|
25 |
+
- Use the slider to control translation length
|
26 |
+
4. **Click Translate**:
|
27 |
+
- Get instant French translation
|
28 |
+
|
29 |
+
## Technical Details
|
30 |
+
|
31 |
+
### Models Used
|
32 |
+
- [T5-small](https://huggingface.co/t5-small) (60M parameters)
|
33 |
+
- [T5-base](https://huggingface.co/t5-base) (220M parameters)
|
34 |
+
|
35 |
+
### Dependencies
|
36 |
+
- Transformers >=4.30.0
|
37 |
+
- PyTorch >=1.10.0
|
38 |
+
- Gradio >=3.40.0
|
39 |
+
- SentencePiece (for tokenization)
|
40 |
+
|
41 |
+
## Deployment
|
42 |
+
|
43 |
+
This app is designed for easy deployment on [Hugging Face Spaces](https://huggingface.co/spaces):
|
44 |
+
|
45 |
+
1. Create a new Space
|
46 |
+
2. Add these files:
|
47 |
+
- `app.py` (main application)
|
48 |
+
- `requirements.txt` (dependencies)
|
49 |
+
3. The Space will automatically build and deploy
|
50 |
+
|
51 |
+
## Local Development
|
52 |
+
|
53 |
+
To run locally:
|
54 |
+
```bash
|
55 |
+
pip install -r requirements.txt
|
56 |
+
python app.py
|