Skip to content

CLOVIS-AI/ccg2lambda-qa-assistant

Repository files navigation

ccg2lambda QA Assistant

Introduction

The goal of this project is to setup a pipeline to unify the ccg2lambda project in a single application.

Especially, this project will make it possible to use a single UI to ask a question, and get an answer back.

Here is a simplified version of the pipeline:

  1. The user writes a sentence in the UI (this project)
  2. The sentence is translated into CCG (by C&C or depccg)
  3. The result is translated into a logical formula (by ccg2lambda)
  4. The formula is parsed into Python objects (by nltk)
  5. The formula is translated into a SPARQL query (this project)
  6. The query is executed, the results are parsed back to text (this project)
  7. The result is displayed to the user in the UI (this project)

Installation & usage

First, clone the project.

Mandatory dependencies

You will need to install the following dependencies, all of which are Free and Open Source (FOSS). This project is based on ccg2lambda, which at the current time of writing is not compatible with Windows; therefore, we are not compatible with Windows systems either.

Optional dependencies: GitLab CI

This project is integrated with GitLab's Continuous Integration tools. To run the pipeline on your computer, you will need the following dependencies:

How to use the Makefile

This project is built around a Makefile, that handles every step of the building.

The Makefile will take care of installing the rest of the dependencies, and of compiling everything.

The main targets are:

  • local (by default) to compile & run the test suites locally
  • gitlab-ci to run the GitLab CI suites locally

Both require a working internet access (HTTPS & SSH).

For example: make local gitlab-ci will:

  • Download and update ccg2lambda
  • Compile the Coq library
  • Create the Python virtual environment
  • Download the models used by spaCy
  • Download the Python requirements (spaCy, DepCCG, Wikipedia...)
  • Install C&C
  • Run the unit tests of the project
  • And do everything again in the GitLab CI container
  • etc.

In particular, the Makefile is crafted to not do useless steps: all the downloads will not happen if the files are already downloaded, the requirements are only downloaded if they are not already, the library is only compiled if it's not already, etc. Therefore, it's much more efficient to always use the Makefile rather than try to do things by hand.

What does this project do?

This project is split into multiple subprojects:

  • server is the main project. It also includes a simple Command Line Interface (CLI) for the project. More information
  • google-assistant handles the integration of the project into the Google Assistant. More information
  • web handles the integration of the project with a web interface. More information

For additional information on how to setup the different subprojects, read their README.md (linked above).

About

Natural language processing of questions using ccg2lambda and SPARQL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •