This repository contains code for the paper:
Long-context Non-factoid Question Answering in Indic Languages
Your data directory should be organized as follows:
data/
├── dataset/
│ └── MuNfQuAD_v2.pkl
├── train_urls.pkl
├── gen2oie_models/
│ └── [downloaded Gen2OIE models here]
MuNfQuAD_v2.pkl and train_urls.pkl can be obtained from MuNfQuAD GitHub.data/gen2oie_models/ (see moie GitHub).Chunking model:
Store the chunking model at:
chunking/state_dicts/model/26_repeat4_best.pth.tar
Install the required dependencies:
pip install -r indicgenqa_req.txt
The pipeline consists of the following main steps:
Tip: Please read the first few lines of each script for command-line arguments (args) and usage details.
Run the coreference resolution model on the dataset (full or subset):
python 01_run_coref.py
python 02a_run_Gen2OIE.py
python 02b_run_IndIE.py
python 02c_intersection.py
python 03a_add_res_data_to_OIE.py
python 03b_add_res_data_to_paras.py
python 04a_Q_sim_para.py
python 04b_Q_sim_triples_wo_c.py
python 04c_Q_sim_triples_w_c.py
python 04d_Q_sim_para_bm25.py
python 04e_Q_sim_para_lc.py
Note:
- APS model does not need to be rerun for A3 (Setting=6); use outputs from 4a and 01.
- Baseline (B) from the paper is Setting=0.
Create data in the format required by LLMs (for all or selected settings): the setting strings specified in step 4 are used here. The data is created for all the settings. You can choose to create data for only the settings you want to run.
python 05_data_creator.py
Fine-tune LLMs using the data from step 5. Supports single/multi-GPU:
python 06_ft_LLMs.py
Note:
The code is written in such a way that it can be run on multiple GPUs. So, you can run it on a single GPU or multiple GPUs. You can also choose to run it on a single GPU based on the resources available to you. The code will automatically detect the number of GPUs available and run the training accordingly. Also note that finetuning of LLMs is not required for the results that are reported on base LLMs. We have provided the code for finetuning the LLMs for your convenience. You can choose to finetune the LLMs or not based on your requirements.
--checkpoint flag): This code supports running inferences on fine-tuned LLMs and base LLMs. You can choose to run it on fine-tuned LLMs or base LLMs based on --checkpoint flag.
python 07a_inference_LLM.py
python 07b_inference_chatgpt.py
python 08a_sts_scores.py
python 08b_sts_scores_chatgpt.py
python 08c_rouge_scores.py
python 09a_agg_sts_scores.py
python 09b_agg_rouge_scores.py
python 10a_LLM_as_judge.py
python 10b_compare.py
python 11a_XAI_scores.py
python 11b_images.py
python 11c_analysis.py
This would be useful to run inferences with checkpoint.
| Setting | gemma-2b | gemma-7b | llama 3.1 |
|---|---|---|---|
| 0 | gn3 | gn5 | gn9 |
| 2.1 (IndIE) | gn10 | gn11 | gn12 |
| 2.2 (Gen2OIE) | gn31 | gn32 | gn33 |
| 4 (IndIE) | gn19 | gn20 | gn21 |
| 4 (Gen2OIE) | gn48 | gn49 | gn50 |
| 5 | gn22 | gn23 | gn24 |
| 5_5 | gn58 | gn59 | gn60 |
| 5_6 | gn61 | gn62 | gn63 |
| 6 | gn25 | gn26 | gn27 |
If you use this code or data, please cite our paper:
@article{mishra2025long,
title={Long-context Non-factoid Question Answering in Indic Languages},
author={Mishra, Ritwik and Shah, Rajiv Ratn and Kumaraguru, Ponnurangam},
journal={arXiv preprint arXiv:2504.13615},
year={2025}
}
5 commits
Python
100.0%
This repository contains code for the paper:
Long-context Non-factoid Question Answering in Indic Languages
Your data directory should be organized as follows:
data/
├── dataset/
│ └── MuNfQuAD_v2.pkl
├── train_urls.pkl
├── gen2oie_models/
│ └── [downloaded Gen2OIE models here]
MuNfQuAD_v2.pkl and train_urls.pkl can be obtained from MuNfQuAD GitHub.data/gen2oie_models/ (see moie GitHub).Chunking model:
Store the chunking model at:
chunking/state_dicts/model/26_repeat4_best.pth.tar
Install the required dependencies:
pip install -r indicgenqa_req.txt
The pipeline consists of the following main steps:
Tip: Please read the first few lines of each script for command-line arguments (args) and usage details.
Run the coreference resolution model on the dataset (full or subset):
python 01_run_coref.py
python 02a_run_Gen2OIE.py
python 02b_run_IndIE.py
python 02c_intersection.py
python 03a_add_res_data_to_OIE.py
python 03b_add_res_data_to_paras.py
python 04a_Q_sim_para.py
python 04b_Q_sim_triples_wo_c.py
python 04c_Q_sim_triples_w_c.py
python 04d_Q_sim_para_bm25.py
python 04e_Q_sim_para_lc.py
Note:
- APS model does not need to be rerun for A3 (Setting=6); use outputs from 4a and 01.
- Baseline (B) from the paper is Setting=0.
Create data in the format required by LLMs (for all or selected settings): the setting strings specified in step 4 are used here. The data is created for all the settings. You can choose to create data for only the settings you want to run.
python 05_data_creator.py
Fine-tune LLMs using the data from step 5. Supports single/multi-GPU:
python 06_ft_LLMs.py
Note:
The code is written in such a way that it can be run on multiple GPUs. So, you can run it on a single GPU or multiple GPUs. You can also choose to run it on a single GPU based on the resources available to you. The code will automatically detect the number of GPUs available and run the training accordingly. Also note that finetuning of LLMs is not required for the results that are reported on base LLMs. We have provided the code for finetuning the LLMs for your convenience. You can choose to finetune the LLMs or not based on your requirements.
--checkpoint flag): This code supports running inferences on fine-tuned LLMs and base LLMs. You can choose to run it on fine-tuned LLMs or base LLMs based on --checkpoint flag.
python 07a_inference_LLM.py
python 07b_inference_chatgpt.py
python 08a_sts_scores.py
python 08b_sts_scores_chatgpt.py
python 08c_rouge_scores.py
python 09a_agg_sts_scores.py
python 09b_agg_rouge_scores.py
python 10a_LLM_as_judge.py
python 10b_compare.py
python 11a_XAI_scores.py
python 11b_images.py
python 11c_analysis.py
This would be useful to run inferences with checkpoint.
| Setting | gemma-2b | gemma-7b | llama 3.1 |
|---|---|---|---|
| 0 | gn3 | gn5 | gn9 |
| 2.1 (IndIE) | gn10 | gn11 | gn12 |
| 2.2 (Gen2OIE) | gn31 | gn32 | gn33 |
| 4 (IndIE) | gn19 | gn20 | gn21 |
| 4 (Gen2OIE) | gn48 | gn49 | gn50 |
| 5 | gn22 | gn23 | gn24 |
| 5_5 | gn58 | gn59 | gn60 |
| 5_6 | gn61 | gn62 | gn63 |
| 6 | gn25 | gn26 | gn27 |
If you use this code or data, please cite our paper:
@article{mishra2025long,
title={Long-context Non-factoid Question Answering in Indic Languages},
author={Mishra, Ritwik and Shah, Rajiv Ratn and Kumaraguru, Ponnurangam},
journal={arXiv preprint arXiv:2504.13615},
year={2025}
}
5 commits
Python
100.0%