论文链接:https://arxiv.org/abs/2104.06378
代码链接:https://github.com/michiyasunaga/qagnn
论文阅读:QA-GNN: Reasoning with Language Models and Knowledge Graphsfor Question Answering
一:环境配置
注意!【暖心小贴士】4060/4070/4080/4090/A40/A400显卡不适配CUDA11.3以下的cuda版本
conda create -n qagnn python=3.7
conda activate qagnn
pip install torch==1.8.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
pip install transformers==3.4.0
pip install nltk spacy==2.1.6
python -m spacy download en
# for torch-geometric
pip install torch-scatter==2.0.7 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-sparse==0.6.9 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-geometric==1.7.0 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
执行 python -m spacy download en 命令后报错:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /explosion/spacy-models/master/shortcuts-v2.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f55533dfd10>: Failed to establish a new connection: [Errno 111] Connection refused'))
解决办法:手动安装:【命名说明:sm/md/lg表示模型的大小(small, medium, large)】
1.去github下载模型,根据自己的spacy的版本下载对应的en版本
https://github.com/explosion/spacy-models/releases
这里给出en2.1.0下载链接