A PyTorch Implementation of Knowledge Graph Question Answering (KGQA) based on Amazon Alexa - E2E Entity Resolution and Question Answering.
The RIGEL model consists of two major components:
-
Entity Resolution: Detect Spans from Natural Language Queries and ground them to Knowledge Graph entities.
-
Inference Module: Learn to model relationships to traverse through the Knowlege Graph to obtain answers for the query.
Inference Module Example Follow Operation (2-hop)
Clone the repo and install requirements.txt in a Python>=3.7.0 environment, including PyTorch>=1.7.
Use the below command to recursively install all the requirements:
>> pip install -r requirements.txt
The config file under ./configs/
is used to set the hyperparameters for model training and checkpoint paths.
To run train use the following command within the environment:
python .\train.py --config './configs/base.json'
The config file under ./configs/
is used to set the hyperparameters for innitializing model checkpoints and the question to inference.
To run train use the following command within the environment:
python .\inference.py --config './configs/base.json'
A screenshot of single query inferencing is show below:
This project is licensed under the MIT License. See the LICENSE file for details.