Model Pipeline - Translation
This pipeline translates sentences from one language to another using a neural network model. It takes text in the source language, processes it, and outputs the translated text in the target language.
Jump into concepts and practice - no test required
This pipeline translates sentences from one language to another using a neural network model. It takes text in the source language, processes it, and outputs the translated text in the target language.
Loss
5.2 |***************
4.0 |************
2.7 |*********
1.9 |******
1.3 |****
1.0 |***
0.85|**
0.75|**
0.70|*
0.68|*
+----------------
Epochs 1 to 10
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 5.2 | 0.15 | Initial training with high loss and low accuracy |
| 2 | 3.8 | 0.35 | Loss decreased, accuracy improved |
| 3 | 2.7 | 0.52 | Model learning better translations |
| 4 | 1.9 | 0.68 | Significant improvement in accuracy |
| 5 | 1.3 | 0.78 | Model converging with good translation quality |
| 6 | 1.0 | 0.83 | Further fine-tuning, stable performance |
| 7 | 0.85 | 0.87 | Loss decreasing steadily, accuracy high |
| 8 | 0.75 | 0.90 | Model producing accurate translations |
| 9 | 0.70 | 0.91 | Minor improvements, nearing best performance |
| 10 | 0.68 | 0.92 | Training converged with low loss and high accuracy |
from transformers import pipeline
translator = pipeline('translation_en_to_de')
result = translator('Hello, how are you?')
print(result[0]['translation_text'])from transformers import pipeline
translator = pipeline('translation_en_to_es')
result = translator('Good morning')
print(result['translation_text'])
What is the error and how to fix it?