Translate a query in natural language to SPARQL query with an interactive web based interface.
Installation guide for spacey
pip install -U spacey
python -m venv .env
source .env/bin/activate
pip install spacey
mkdir myproject
cd myproject
python3 -m venv venv
.venv/bin/activate
pip install Flask
To generate the training data, execute the following commands
mkdir data/monument_300
python generator.py --templates data/annotations_monument.csv --output data/monument_300
Now go back to the initial directory and launch train.sh to train the model. The first parameter is the prefix of the data directory and the second parameter is the number of training epochs.
sh train.sh data/monument_300 120000
This command will create a model directory called data/monument_300_model.
Predict the SPARQL sentence for a given question with a given model. In this, we wil run back.py. After that go to http://localhost:5000/result on any web browser. This has front end. Enter your query and sparql sentence will be generated in next page.