Downloads · 30 days
62
8% of all-time downloads
NLPclass/mt5_en_fa_translation
mt5_en_fa_translation is a machine learning model from NLPclass. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Model Description: This model is designed to translate text from English to Persian (Farsi) using the MT5-Small architecture. MT5 is a multilingual variant of the T5 model, pretrained on a diverse set of languages.
Downloads · 30 days
62
8% of all-time downloads
All-time downloads
754
Public
Parameters
300M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 100%
From the Hugging Face model README
Model Description: This model is designed to translate text from English to Persian (Farsi) using the MT5-Small architecture. MT5 is a multilingual variant of the T5 model, pretrained on a diverse set of languages.
Intended Use: The model is intended for use in applications where automatic translation from English to Persian is required. It can be used for translating documents, web pages, or any other text-based content.
Model Architecture:
Dataset: The model was trained on a dataset consisting of 100,000 parallel sentences of English and Persian text. The data includes various sources to cover a wide range of topics and ensure diversity.
Data Preprocessing:
Training Configuration:
Hardware:
import torch
from transformers import pipeline, MT5ForConditionalGeneration, MT5Tokenizer, Text2TextGenerationPipeline
# Function to translate using the pipeline
def translate_with_pipeline(text):
translator = Text2TextGenerationPipeline(model='NLPclass/mt5_en_fa_translation',tokenizer='NLPclass/mt5_en_fa_translation')
return translator(text,, max_length=128,num_beams=4)[0]['generated_text']
# Example usage
text = "Hello, how are you?"
# Using pipeline
print("Pipeline Translation:", translate_with_pipeline(text))
If you use this model in your research or applications, please cite it as follows:
@misc{mt5_en_fa_translation,
author = {NLPclass},
title = {English to Persian Translation using MT5-Small},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/NLPclass/mt5_en_fa_translation}},
}