Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
QuestionAnswering askCO launcher fixed according to new pom Oct 8, 2018
QuestionAnsweringBenchmark.tsv Question Answering over CodeOntology May 11, 2018
askCO askCO launcher fixed according to new pom Oct 8, 2018

Question Answering over CodeOntology

This system leverages CodeOntology to translate complex natural language questions into an appropriate Java source code.

For instance, the question:

What is the cube root of the max between 20 and 27?

is translated into the following Java source code:

java.lang.Math.cbrt(java.lang.Double.max(20, 27))

which is executed to retrieve the desired answer.


First, be sure that Fuseki is running at localhost:3030. If you don't have Fuseki installed, you can get it by following the instructions available here.

Next, you should download the dataset extracted by applying CodeOntology to the OpenJDK 8 project. It is available on Zenodo under CC BY 4.0 license.

Create a new dataset named OpenJDK on Fuseki and load all the files you have downloaded from Zenodo to the newly created dataset.

Now, you should be able to use Fuseki to run simple queries on CodeOntology. For instance, you can select all methods from OpenJDK computing the cube root of a real value by running the following SPARQL query:

SELECT ?method
  ?method a woc:Method ;
          woc:hasParameter/woc:hasType woc:Double ; 
          dul:associatedWith dbr:Cube_root .


This system makes use of a pre-trained Word2Vec model. You can download it from Google Drive or simply run the following script, which will place the file in nlp/WordVectors:

$ ./

Build and Run

The system is built with Maven. Be sure to use OpenJDK 8 (incompatibility with JDK 10 is known). Hence, you only have to run the following commands:

$ cd QuestionAnswering
$ mvn package

Now, you are ready to run the tool:

$ ../askCO
You can’t perform that action at this time.