Translate a query in natural language to SPARQL query with an interactive web based interface.
Go to Untitled1.ipynb
The below steps are optional
Create a virtual env -
python -m venv .env
source .env/bin/activateInstall requirements -
pip install spaceypip install FlaskTo generate the training data, execute the following commands
mkdir data/monument_300python generator.py --templates data/annotations_monument.csv --output data/monument_300Now 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 120000This 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.