Git Product home page Git Product logo

nlp-intent-toolkit's Introduction

nlp-intent-toolkit

Recognizing intents with slots using OpenNLP for applications (such as bots using chat, IM, speech-to-text) to convert natural language into structured commands with arguments.

> What's the current stock price of General Motors?
{ action: 'stock-price', args: { company: 'General Motors' } }

The example system uses document categorization to determine the intent (command) and entity recognition to determine the slots (arguments) of the natural language text input.

The training system uses 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 does 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: { city: 'seattle' } }

>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: { } }

Copyright and License

The source code provided by this repository is free and unencumbered to be copied or modified for any purpose, commercial or non-commercial. The full license text is provided in the LICENSE file accompanying this repository.

nlp-intent-toolkit's People

Contributors

mlehman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nlp-intent-toolkit's Issues

Can only use one entity type

When I add multiple entity types, the output is incorrect.

For example, if I ask "do you accept cigna?"

The output is like this:
{ action: 'payment', args: { service_offered: 'cigna' insurance_company: 'cigna' form_of_payment: 'cigna' lender: 'cigna' } }

I would expect this output:
{ action: 'payment', args: { insurance_company: 'cigna' } }

Project has no license.

Hi - this project looks really interesting and I'd like to try building something based on it, but there's no licensing info in the project -- could you add a license file to the project, or a note in the README, to make clear the terms of use? Thanks!

Explanation?

hi Matt

Is there a way to get an explanation on how this works? Specifically, where in the code is the intent output?

Thanks very much for any lead!
Lior

can we have model which distinguishes sentence with intent from a given a input text ?

can we have model which distinguishes sentence with intent from a given a input text ?

like below example :
"Turn the bathroom light off and remind me to take the trash out."
There are two independent intents here:
turn_lights, set_reminder.
similarly another example : "Hey what's up? do you guys offer free trial?"
there are two intents here : greetings , product_pricing

Thanks & Regards,
Achyuta nanda Sahoo

[question] Intent corpus

Hi Matt. Do you know any public corpus of sentences and intents? It would be great to compare opennlp with other services. I think that you don't have enough examples but I haven't found anything better/bigger yet.

Webserver

Hello, first of all, I'd like to thank you for your work on this repo, it really helps me out as it's just what I need !
I have been trying for a week or two to make a webserver based on your repo but as I don't know Java at all, it hasn't been too easy to make it work...

I could have asked you how to do that two weeks ago but I dont like to give up. So I forked your repo and tried to build some sort of webserver.
I first tried to wrap the java application in a ruby app, that did not work, I tried to wrap it in a nodejs app, that did not work either. Actually, when wrapped in an other application, java doesnt seem to be able to find the right console file descriptor so it kind of waits forever regardless of the input in the console.

I came up with a solution that works but is not very efficient :
I setup an expressjs app, when a user sends a http request, node generates a hash and crate a files with the name [hash].source, in the mean time, the java application, watches a specific folder and awaits for a .source file to appear, as it appears, it reads the file, does whatever it has to do with the sentence, then crates a file with the same [hash].result. While java is doing this, node is waiting for a [hash].result file, when it finds it, it builds the output, send a response to the user and save the log.

Anyways, now that I have learnt java a little bit through all the changes I have made in your code, I'd like to know if there is a way with maven to easily build a webserver. Would you be able to help me with this ot is it just a huge pain in the butt ?

Thank you in advance for your response, and thank you again for your great work

PS. : my webserver works very well, here is the repo : https://github.com/bastienbot/nlp-intent-toolkit

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.