--- library_name: transformers license: apache-2.0 base_model: Helsinki-NLP/opus-mt-en-vi model-index: - name: trinhhuy/finetuned-opus-mt-en-vi results: [] datasets: - harouzie/vi_en-translation language: - en - vi pipeline_tag: translation --- # trinhhuy/finetuned-opus-mt-en-vi This model is a fine-tuned version of [Helsinki-NLP/opus-mt-en-vi](https://huggingface.co/Helsinki-NLP/opus-mt-en-vi) on harouzie/vi_en-translation dataset. It achieves the following results on the evaluation set: - Train Loss: 0.1596 - Validation Loss: 0.2877 - Epoch: 3 - Bleu: 77.71982942978268 ## Model description ### 🧪 Quick Start First, make sure to install the `transformers` library: ```bash pip install transformers ``` Option 1: Use a pipeline as a high-level helper ```python from transformers import pipeline pipe = pipeline("translation", model="trinhhuy/finetuned-opus-mt-en-vi") result = pipe("I'm confident that my friend will pass the exam because he has been studying hard and staying focused for weeks.") print(result) ``` ```text [{'translation_text': 'Tôi tự tin rằng bạn tôi sẽ vượt qua kỳ thi vì anh ấy đã học tập chăm chỉ và tập trung nhiều tuần.'}] ``` Option 2: Load model directly ```python from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("trinhhuy/finetuned-opus-mt-en-vi") model = AutoModelForSeq2SeqLM.from_pretrained("trinhhuy/finetuned-opus-mt-en-vi") input_tokenized = tokenizer("I'm confident that my friend will pass the exam because he has been studying hard and staying focused for weeks.", return_tensors="pt") output_tokenized = model.generate(**input_tokenized) translated_text = tokenizer.decode(output_tokenized[0], skip_special_tokens=True) print(translated_text) ``` ```text Tôi tự tin rằng bạn tôi sẽ vượt qua kỳ thi vì anh ấy đã học tập chăm chỉ và tập trung nhiều tuần. ``` ### Training hyperparameters The following hyperparameters were used during training: - initial_learning_rate = 5e-05 - weight_decay_rate = 0.01 - training_precision: mixed_float16 ### Training results | Train Loss | Validation Loss | Epoch | |:----------:|:---------------:|:-----:| | 0.4246 | 0.3235 | 0 | | 0.2724 | 0.2977 | 1 | | 0.2019 | 0.2887 | 2 | | 0.1596 | 0.2877 | 3 | ### Framework versions - Transformers 4.53.3 - TensorFlow 2.18.0 - Datasets 4.0.0 - Tokenizers 0.21.2