Skip to content

byomakeshpanda/Entity-Aware-Machine-Translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entity-Aware Machine Translation (EA-MT)

Table of Contents

Overview

This project implements Entity-Aware Machine Translation (EA-MT) using Flan-T5 with multi-task learning for English to French language. The model is trained simultaneously on Named Entity Recognition (NER) and EA-MT tasks, with a higher weight given to the EA-MT task in the loss function. This approach improves translation quality, particularly for rare words and named entities.

Steps for Inference

  1. Clone the Repository
    Clone the GitHub repository and navigate to the project directory or you can download the entire repo in zip format:

    git clone https://github.com/byomakeshpanda/Entity-Aware-Machine-Translation.git
    
    cd Entity-Aware-Machine-Translation
  2. Create and Activate a Conda Environment Create a new Conda environment and activate it:

    conda create --name ea-mt python=3.12.9 -y
    conda activate ea-mt
  3. Install Dependencies

    Install all required dependencies:

    pip install -r requirements.txt
  4. Download the Pretrained Model

  • Download the model from link.
  • Extract the ZIP file and rename the extracted folder to t5_large_finetuned.
  • Move the t5_large_finetuned folder to src\model path.
  • Ensure you are inside the Entity-Aware-Machine-Translation directory before proceeding.
  1. Run Inference

To randomly sample given number of test samples and compute the BLEU score run the following command:

 python src/inference/predict_test.py

To input an English sentence and retrieve entity aware translated french sentence run the following command:

python src/inference/predict_sample.py

Results

Achieved BLEU score of 44.7.

References

Team Members:

  • Byomakesh Panda (M24DS004)
  • Rishav Kumar (M24DS012)
  • Sugandh Kumar (M24DS016)

About

This project implements a multi-task learning framework for Entity-Aware Machine Translation (English → French) using Flan-T5. The model jointly learns Named Entity Recognition (NER) and translation, improving performance on rare words and named entities — crucial for real-world NLP applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors