Git Product home page Git Product logo

nlp-intent-toolkit's Introduction

nlp-intent-toolkit

Recognizing intents with slots using OpenNLP.

This is an example of using OpenNLP to train a system to accept natural language input, particularly via a speech-to-text source, and return a recognized action with arguments. The system uses document categorization to determine the action for inputs and entity recognition to determine the arguments. The training system requires a directory containing separate files for each possible action, in this case the actions in a fictitious weather application:

- example/weather/train
  - current-weather.txt - get the current weather
  - hourly-forecast.txt - get the hourly forcast
  - five-day-forecast.txt - get a five day forecast

Each training file contains one example per line with any possible arguments surrounded by mark up to indicate the name of the parameter:

file: five-day-forecast.txt
...
how dos the weather look for this Thursday in <START:city> Boston <END>
is it going to snow this week in <START:city> Chicago <END>
show me the forecast for <START:city> Denver <END>
...

Running the Example

The training systems is run passing in the training file directory and any parameter name used in the training files.

$ mvn clean compile exec:java  -Dexec.args="example/weather/train city"
...
Training complete. Ready.

>show me the weather for chicago
action=current-weather args={ city=chicago }

>will it rain tonight
action=hourly-forecast args={ }

>how does it look in seattle
action=hourly-forecast args={ }

>what are the conditions in new york
action=current-weather args={ city=new york }

>how does this weekend look in boston
action=five-day-forecast args={ city=boston }

>give me the five day forecast
action=five-day-forecast args={ }

nlp-intent-toolkit's People

Contributors

mlehman avatar

Watchers

James Cloos avatar Christophe Willemsen 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.