Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Towards Graph-hop Retrieval and Reasoning in Complex Question Answering over Textual Database

[COLING 2024] The code for ReasonGraphQA

Prerequisites

  • python 3.7 with pytorch (1.10.0), transformers(4.15.0), tqdm, accelerate, pandas, numpy, sentencepiece, sklearn, networkx
  • cuda10/cuda11

Installing the GPU driver

# preparing environment
sudo apt-get install gcc
sudo apt-get install make
wget https://developer.download.nvidia.com/compute/cuda/11.5.1/local_installers/cuda_11.5.1_495.29.05_linux.run
sudo sh cuda_11.5.1_495.29.05_linux.run

Installing Conda and Python

# preparing environment
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chmod 777 Miniconda3-latest-Linux-x86_64.sh 
bash Miniconda3-latest-Linux-x86_64.sh

conda create -n TreeHop python==3.7
conda activate TreeHop

Installing Python Libraries

# preparing environment
pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
pip install tqdm transformers sklearn pandas numpy networkx accelerate sentencepiece

Data

We provide the reasontree dataset in the Graphhop data:https://drive.google.com/drive/folders/1Ix-Xc3yvTyY9T1ibzRAzFAFbup3olOmM?usp=sharing

BiDGR

How to train:
python train_F.py #Run forward graph retrieval
python train_B.py #Run backward graph retrieval
How to eval:
python eval.py #When the training is over, eval.py file will read the last saved model weight and test the score

Cite

@article{zhu2023towards,
  title={Towards Graph-hop Retrieval and Reasoning in Complex Question Answering over Textual Database},
  author={Zhu, Minjun and Weng, Yixuan and He, Shizhu and Liu, Kang and Zhao, Jun},
  journal={arXiv preprint arXiv:2305.14211},
  year={2023}
}

About

[COLING 2024] The code for ReasonGraphQA

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages