Authors:
Date: March 26, 2025 (Last Update)
This project focuses on developing a specialized framework that efficiently transfers knowledge from Hindi (a high-resource language) to Chhattisgarhi (a low-resource language) using reinforcement learning and knowledge distillation techniques. Our goal is to optimize core transfer learning mechanisms to achieve efficient cross-lingual transfer.
The project utilizes the following key components:
NLLB-Enhanced Transfer Learning: We use the No Language Left Behind (NLLB) dataset as the foundation for our transfer learning model. This dataset provides a diverse set of language pairs to enhance the cross-lingual capabilities of our system.
Reinforcement Learning for Selective Knowledge Transfer: Reinforcement learning (RL) is employed to dynamically determine the optimal parameters for transferring knowledge from Hindi to Chhattisgarhi, ensuring that only the most relevant information is transferred effectively.
Bidirectional Lexical Mapping: The project leverages existing Hindi-Chhattisgarhi parallel data to build a bidirectional lexical mapping, which enhances the quality of the language transfer by providing a richer understanding of both languages.
Knowledge Distillation: We implement confidence-guided distillation techniques to ensure that the distilled knowledge from the high-resource language (Hindi) is effectively transferred to the low-resource language (Chhattisgarhi).
/mt BranchNavigate to the /mt branch of the GitHub repository. This branch focuses on machine translation. Clone the repository or download it to your local system.
Make sure you're in the root directory of the project on your local machine. Also, ensure that you have sufficient GPU resources available to run the project locally.
Install the required dependencies listed in the requirements.txt file using pip or any other package manager you prefer.
If you encounter any errors related to WordNet or NLTK during installation, run the script scripts/post_req.py. This will automatically resolve the issues.
The dataset for the project can be downloaded using the script scripts/download_data.py. However, this step is optional as the dataset is small and has already been uploaded to GitHub.
You can run the project in four different modes. Below are the modes and the respective commands to run:
Fine-tuning the base model:
python -m src.main --mode train_base
Training the model using knowledge distillation:
python -m src.main --mode train_distillation
Using reinforcement learning (RL) guided knowledge distillation:
python -m src.main --mode train_rl
Evaluation:
python -m src.main --mode evaluate
Note: You may change the config by defining the arguments on command line.
Select the mode you wish to run and pass it as an argument when executing the script. For example, to train the base model, use the following command:
python -m src.main --mode train_base --train_data data/processed/train.json
For evaluation: code will ask for a checkpoint path. download the most recent checkpoint from here [https://drive.google.com/file/d/181WNX-74pk_tdb941rz4s5ryDsEmJSDu/view?usp=sharing], create a folder named checkpoints in the root directory & store the downloaded model checkpoint there, set the mode to evaluate and provide the path to the checkpoint. Also provide the relevant model & ensure that the checkpoint belongs to that model itself. else, run the script given below:
python -m src.main --mode evaluate --model_name facebook/mbart-large-50 --checkpoint_path checkpoints/student_episode_1.pt
After training or evaluation, the relevant checkpoints, logs, and results will be saved in their respective directories located in the root folder of the project.
Though Extensive Tests, Ablation Studies & Hyperparameter Tuning (especially RL-Based) is yet to be done, the RL-Guided distilled model has shown a BLEU Score of 31.67 after just 1 episode compared to the score of 25.64 obtained by simple Fine-Tuned Model after 1 epoch of fine tuning.
Feel free to open an issue or submit a pull request if you'd like to contribute to the project.
For any inquiries, please contact:
======= Project Repo for Deep Learning for Low Resource NLP Course Project.
75 commits
1 commits
Python
100.0%
Authors:
Date: March 26, 2025 (Last Update)
This project focuses on developing a specialized framework that efficiently transfers knowledge from Hindi (a high-resource language) to Chhattisgarhi (a low-resource language) using reinforcement learning and knowledge distillation techniques. Our goal is to optimize core transfer learning mechanisms to achieve efficient cross-lingual transfer.
The project utilizes the following key components:
NLLB-Enhanced Transfer Learning: We use the No Language Left Behind (NLLB) dataset as the foundation for our transfer learning model. This dataset provides a diverse set of language pairs to enhance the cross-lingual capabilities of our system.
Reinforcement Learning for Selective Knowledge Transfer: Reinforcement learning (RL) is employed to dynamically determine the optimal parameters for transferring knowledge from Hindi to Chhattisgarhi, ensuring that only the most relevant information is transferred effectively.
Bidirectional Lexical Mapping: The project leverages existing Hindi-Chhattisgarhi parallel data to build a bidirectional lexical mapping, which enhances the quality of the language transfer by providing a richer understanding of both languages.
Knowledge Distillation: We implement confidence-guided distillation techniques to ensure that the distilled knowledge from the high-resource language (Hindi) is effectively transferred to the low-resource language (Chhattisgarhi).
/mt BranchNavigate to the /mt branch of the GitHub repository. This branch focuses on machine translation. Clone the repository or download it to your local system.
Make sure you're in the root directory of the project on your local machine. Also, ensure that you have sufficient GPU resources available to run the project locally.
Install the required dependencies listed in the requirements.txt file using pip or any other package manager you prefer.
If you encounter any errors related to WordNet or NLTK during installation, run the script scripts/post_req.py. This will automatically resolve the issues.
The dataset for the project can be downloaded using the script scripts/download_data.py. However, this step is optional as the dataset is small and has already been uploaded to GitHub.
You can run the project in four different modes. Below are the modes and the respective commands to run:
Fine-tuning the base model:
python -m src.main --mode train_base
Training the model using knowledge distillation:
python -m src.main --mode train_distillation
Using reinforcement learning (RL) guided knowledge distillation:
python -m src.main --mode train_rl
Evaluation:
python -m src.main --mode evaluate
Note: You may change the config by defining the arguments on command line.
Select the mode you wish to run and pass it as an argument when executing the script. For example, to train the base model, use the following command:
python -m src.main --mode train_base --train_data data/processed/train.json
For evaluation: code will ask for a checkpoint path. download the most recent checkpoint from here [https://drive.google.com/file/d/181WNX-74pk_tdb941rz4s5ryDsEmJSDu/view?usp=sharing], create a folder named checkpoints in the root directory & store the downloaded model checkpoint there, set the mode to evaluate and provide the path to the checkpoint. Also provide the relevant model & ensure that the checkpoint belongs to that model itself. else, run the script given below:
python -m src.main --mode evaluate --model_name facebook/mbart-large-50 --checkpoint_path checkpoints/student_episode_1.pt
After training or evaluation, the relevant checkpoints, logs, and results will be saved in their respective directories located in the root folder of the project.
Though Extensive Tests, Ablation Studies & Hyperparameter Tuning (especially RL-Based) is yet to be done, the RL-Guided distilled model has shown a BLEU Score of 31.67 after just 1 episode compared to the score of 25.64 obtained by simple Fine-Tuned Model after 1 epoch of fine tuning.
Feel free to open an issue or submit a pull request if you'd like to contribute to the project.
For any inquiries, please contact:
======= Project Repo for Deep Learning for Low Resource NLP Course Project.
75 commits
1 commits
Python
100.0%