Machine__Translation
Machine__Translation
Dr. Shylaja S S
Director of Cloud Computing & Big Data (CCBD), Centre for
Data Sciences & Applied Machine Learning (CDSAML)
Department of Computer Science and Engineering
[email protected]
Machine Translation in NLP
What is Machine Translation?
• Machine Translation (MT) is the automatic translation of text between languages
using AI.
• Used in NLP applications to bridge language gaps and improve global
communication.
Why is Machine Translation Important?
• Bridges Language Barriers – Enables global communication.
• Saves Time & Effort – Automates translations instead of manual work.
• Enhances Business Expansion – Helps companies operate in multilingual markets.
• Aids Education & Research – Provides access to multilingual information.
Types of Machine Translation
translator = Translator()
text = "Hello, how are you?"
translated_text = translator.translate(text, dest="fr")
print("Translated Text:", translated_text.text)
```
Neural Machine Translation using MarianMT
```python
from transformers import MarianMTModel, MarianTokenizer
model_name = "Helsinki-NLP/opus-mt-en-fr"
tokenizer = MarianTokenizer.from_pretrained(model_name)
model = MarianMTModel.from_pretrained(model_name)
translator = pipeline("translation_en_to_fr")
text = "Hello, how are you?"
translated_text = translator(text)[0]["translation_text"]
print("Translated Text:", translated_text)
```
Challenges in Machine Translation