All Projects → garfix → nli-go

garfix / nli-go

Licence: MIT License
Natural Language Interface in GO, a semantic parser and execution engine.

Programming Languages

javascript
184084 projects - #8 most used programming language
go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to nli-go

Nlp Recipes
Natural Language Processing Best Practices & Examples
Stars: ✭ 5,783 (+28815%)
Mutual labels:  natural-language, nli
nl4dv
A python toolkit to create Visualizations (Vis) using natural language (NL) or add an NL interface to existing Vis.
Stars: ✭ 63 (+215%)
Mutual labels:  natural-language, natural-language-interface
bert nli
A Natural Language Inference (NLI) model based on Transformers (BERT and ALBERT)
Stars: ✭ 97 (+385%)
Mutual labels:  nli
fillers
List of (possible) English filler words
Stars: ✭ 36 (+80%)
Mutual labels:  natural-language
NLP-Natural-Language-Processing
Projects and useful articles / links
Stars: ✭ 149 (+645%)
Mutual labels:  natural-language
hedges
List of (possible) English hedge words
Stars: ✭ 39 (+95%)
Mutual labels:  natural-language
openvalidation
Compose validation rules in the language you use every day, openVALIDATION handles code creation for you.
Stars: ✭ 62 (+210%)
Mutual labels:  natural-language
automation-for-humans
Converts English statements to automation.
Stars: ✭ 67 (+235%)
Mutual labels:  natural-language
react-taggy
A simple zero-dependency React component for tagging user-defined entities within a block of text.
Stars: ✭ 29 (+45%)
Mutual labels:  natural-language
n2words
Convert numerical numbers to written numbers, in 25+ languages.
Stars: ✭ 44 (+120%)
Mutual labels:  natural-language
gdpr-fingerprint-pii
Use Watson Natural Language Understanding and Watson Knowledge Studio to fingerprint personal data from unstructured documents
Stars: ✭ 49 (+145%)
Mutual labels:  natural-language
TabularSemanticParsing
Translating natural language questions to a structured query language
Stars: ✭ 148 (+640%)
Mutual labels:  natural-language-interface
buzzwords
List of (possible) English buzzword words
Stars: ✭ 51 (+155%)
Mutual labels:  natural-language
TextFeatureSelection
Python library for feature selection for text features. It has filter method, genetic algorithm and TextFeatureSelectionEnsemble for improving text classification models. Helps improve your machine learning models
Stars: ✭ 42 (+110%)
Mutual labels:  natural-language
retext-spell
plugin to check spelling
Stars: ✭ 53 (+165%)
Mutual labels:  natural-language
consistency
Implementation of models in our EMNLP 2019 paper: A Logic-Driven Framework for Consistency of Neural Models
Stars: ✭ 26 (+30%)
Mutual labels:  nli
aprenda-python
Aprendizado, dicas e projetos sobre Python
Stars: ✭ 22 (+10%)
Mutual labels:  natural-language
remark-retext
plugin to transform from remark (Markdown) to retext (natural language)
Stars: ✭ 18 (-10%)
Mutual labels:  natural-language
apertium-html-tools
Web application providing a fully localised interface for text/website/document translation, analysis and generation powered by Apertium.
Stars: ✭ 36 (+80%)
Mutual labels:  natural-language
rita
Website, documentation and examples for RiTa
Stars: ✭ 42 (+110%)
Mutual labels:  natural-language

NLI-GO

This is a research project with the following purpose:

To create a programming environment that allows a regular programmer, untrained in linguistics and logic, to program a computer to interact with users in natural language. The environment should be easy to use and the range of language constructs should be very wide.

The emphasis of the project is on developing declarative structures that are both easy to use and very expressive. To this end, different forms of linguistic and logical representations are considered. From these, a new representation is distilled, that focuses on programmability.

Its product is a semantic parser and execution engine (an executable program, written in Go) that provides a Natural Language Interface to a database, a service or another application. It allows the user to interact with a computer system using natural language like English or French.

It is a rule based system that requires the developer to write rules by hand. Thus, the developer has full control over the behaviour of the system. Its semantics are not functional, but procedural.

The application is not production ready, but you can use it to experiment. The system is not at all robust and will break easily. Backward-incompatible changes will be made from time to time.

Web demo

A demo of this program can be found here. It allows you to use a few sentences to query DBPedia.

Features

  • An Earley parser to create a syntax tree from an input sentence, with semantic attachments
  • Morphological analysis that performs segmentation and parsing of morphemes
  • Mentalese, a based internal language, based on Predicate Logic, to process the user input
  • A language with a Prolog-like syntax for rule based reasoning
  • Support for access to Sparql and MySQL databases as well as in-memory data stores
  • Combining data from multiple databases in reaction to a single request
  • Modify internal and MySQL databases with Assert (insert) and Retract (delete)
  • A dialog context to remember information from earlier in the conversation
  • Anaphora resolution: the use of pronouns and other references to earlier entities
  • Generalized quantifiers
  • The distinction between classic negation (not) and strong negation (-)
  • A generator to produce human readable responses
  • Modules and namespaces, for modular development

Build the nli executable

NLI-GO is a command-line application called "nli". It's written in Go and you must compile it into an executable for your OS.

You can download and install GO from here

From the root of NLI-GO build the executable with

go build -o bin/nli bin/nli.go

On Windows, you may want to use go build -o bin/nli.exe bin/nli.go.

You can and move the executable to another location if you like.

Run NLI-GO in interactive mode

NLI-GO comes with some sample applications, located in the directory "resources". The application resources/blocks, for example, is an attempt to recreate the results of SHRDLU. Start an interactive session with it like this:

bin/nli inter -a resources/blocks   

NLI-GO will then show

NLI-GO session with resources/blocks. Type 'exit' to stop.

> 

and you can type, for instance:

> Pick up a big red block

and NLI-GO, like SHRDLU in the old days, will reply with

OK

The sentences that this applications can currently handle can be found in tests/integration/BlocksWorld_test.go, but you can try other sentences to see if they work.

When done, just type

exit 

Run NLI-GO in single-request mode

NLI-GO can also be used just to give a single response. This allows you to use it as part of a larger system. This variant is used by the web demo, for instance. In this example you tell "Hello World" to the hello world application:

bin/nli answer -a resources/helloworld "Hello World"    

and it responds with

Welcome!

This is the response of the application, or the error, if something went wrong. If you need more control over the output of the system, you can add -r json; like this

bin/nli answer -a resources/helloworld -r json "Hello World"    

and NLI-GO responds with a JSON string like this:

{
    "Success": true,
    "ErrorLines": [],
    "Productions": [
        "Anaphora queue: [] ",
        "TokenExpression: [Hello World] ",
        "Parse trees found: : 1 ",
        "Parser: [s [hello Hello] [world World]] ",
        "Relationizer: go_intent(start_conversation) dom_hello() ",
 ...
        "Answer Words: [Welcome!] ",
        "Answer: Welcome! "
    ],
    "Answer": "Welcome!",
    "OptionKeys": [],
    "OptionValues": []
}

If the system responds with a clarification question, it does this with a number of options the user can choose from

  • OptionKeys: the keys of these options
  • OptionValues: the values of these options

And if you want to specify a session identifier to allow NLI-GO to resolve back-references to earlier parts of the dialog, use -s with an identifier of your choice.

bin/nli answer -a resources/helloworld -s 64152 "Hello World"    

To reset the session, use

bin/nli reset -s 64152

Trying it out

If you want to experiment with NLI-GO, copy one of the application directories in resources and make changes to it.

Docs

Much information on how to build an NLI-GO application can be found in How to build an NLI application.

If you want to follow my thoughts as I develop NLI-GO, you can read it here: My personal log

And this is an overview of How NLI-GO processes a request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].