Coder Social home page Coder Social logo

question-answering's Introduction

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.

CodeOntology

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
WHERE {
  ?method a woc:Method ;
          woc:hasParameter/woc:hasType woc:Double ; 
          dul:associatedWith dbr:Cube_root .
}

Word2Vec

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:

$ ./getW2V.sh

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

question-answering's People

Contributors

rizasif avatar mattia-atzeni avatar atzori avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.