Git Product home page Git Product logo

cocoqa's Introduction

CocoQa

An auto QA system about code convention and styles based on knowledge base

Ontology & RDF

We construct a knowledge base called CCBase in the field of coding convention. Ontology folder contains the ontology of CCBase, including subject types, relations and so on, which is in the form of owl. RDF folder contains some entities of our CCBase.

Plugin

We developed an Intellij Idea plugin. You can download plugin.zip and install it by the instructions of Idea.

Introduction

Design of CCQA

In the algorithm folder is the CCQA system. CCQA can assist programmers to retrieval information about coding conventions in a more natural manner.
One of the algorithm of CCQA is subgraph matching. Inspired by Hu et al.โ€™s work, we propose the LE (long entity) Node-First framework to answer coding convention questions by subgraph matching.We first extract semantic relations based on the dependency tree of question sentences to build a semantic query graph Qu. A semantic relation is a triple <rel; arg1; arg2>, where rel is a relation phrase, and arg1 and arg2 are its associated node phrases. After that, a SPARQL query statement is generated from Qu and then executed to get final answers.

We also integrate an end-to-end machine comprehension approach that applies a deep neural network to answer the query on textual paragraphs attached in CCBase. The introduction and procedure to run machine comprehension QA could be found here . A logistic regression classifier is trained to merge and rank the answers, and retrieve the top ones.

Install

It is a web application and we developed a graphical interface. After installing the following python packages, you can run FLASK server and experience CCQA.
Dependencies
First of all, you should download Stanford CoreNLP toolkit and run the server.

cd stanford-corenlp-full-${version}
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000

Then, Stanford CoreNLP server will listen on port 9000 for requests.
After that, the following python packages have to be installed.

Python 2.7.0
Flask==1.0.2
Flask-Cors==3.0.7
gunicorn==19.9.0
pyahocorasick==lattest
SPARQLWrapper==1.8.2
stanfordcorenlp==3.9.1.1

Run

cd code-convention-robot
gunicorn -b 0.0.0.0:${port} server:app

Now, you can visit localhost:5000/ordinary to experience our system!

cocoqa's People

Contributors

14dtj avatar flyboss avatar jamescao2048 avatar

Watchers

 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.