CoolFace
Modelpublic

Meher2006/english-to-telugu-model

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
3likes222downloads
Model Card

🚀 English-to-Telugu Translation Model

This model translates English text to Telugu using a fine-tuned transformer model. It is designed for general-purpose translation and supports a wide range of vocabulary and sentence structures.

Model Details

  • —Model Name: English-to-Telugu Translation Model
  • —Base Model: mBART
  • —Languages: English → Telugu
  • —Framework: 🤗 Transformers (PyTorch)
  • —Use Case: Machine translation for common phrases, sentences, and general conversation.

Usage Example in Python

python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer  

# Load the model and tokenizer  
model_name = "Meher2006/english-to-telugu-model"  
tokenizer = AutoTokenizer.from_pretrained(model_name)  
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)  

# Function to translate text  
def translate(text):  
    inputs = tokenizer(text, return_tensors="pt")  
    outputs = model.generate(**inputs)  
    return tokenizer.decode(outputs[0], skip_special_tokens=True)  

# Example Usage  
sentences = [  
    "Hello, how are you?",  # Output: హలో, మీరు ఎలా ఉన్నారు?
    "What is your name?",  # Output: మీ పేరు ఏమిటి?
    "I enjoy learning new languages.",  # Output: నాకు కొత్త భాషలు నేర్చుకోవడం ఇష్టం.
    "Please help me with this task.",  # Output: దయచేసి ఈ పనిలో నాకు సహాయపడండి.
    "Thank you.",  # Output: ధన్యవాదాలు.
    "How are you doing?"  # Output: నువ్వు ఎలా ఉన్నావు?
]  

for sentence in sentences:  
    print(f"English: {sentence}")  
    print(f"Telugu: {translate(sentence)}")  
    print("----")