ibm-cloud-solutions / hubot-ibmcloud-nlc

Adds a framework to enable Natural Language interactions in your Hubot scripts
http://www.ibm.com/
Other
11 stars 1 forks source link

Allow Parameter to be longer then just one word (e.g. a question in quotation marks) #105

Closed iStooge closed 8 years ago

iStooge commented 8 years ago

In my case I need the Classifier to get a parameter that is longer then one word, so it is not just an entity. Is it possible that the NLC recognizes a parameter in longer form then just one word? As in the last step of the conservation in the screenshot below.

Later i want hubot to be able to take a whole question as a parameter for example "How can we solve the atomic waste problem?" to save it as a question that is given to the users.

Is it perheps possible to mark the parameter with quotation marks as in my example? So that hubot recognizes this as parameter.

image

jlpadilla commented 8 years ago

Check the repo https://github.com/ibm-cloud-solutions/hubot-ibmcloud-cognitive-entities

Maybe @JonHoughton has a better suggestion.

JonHoughton commented 8 years ago

@jlpadilla is correct that the hubot-ibmcloud-cognitive-entities is the repository that handles the entity processing.

The problem here is that even though you know that 'Car and Bike' is the entity value that you would like to end up with it is not clear how to tell the code that you wanted 'Car and Bike', 'Car', or 'Bike' when processing the line as a natural language string of text.

If there is a known set of entity values: 'Trees and Flowers', ..., and 'Cars and Bikes' then the best way to handle this is by seeding the set of known entities using nlcconfig.updateGlobalParameterValues() and/or nlcconfig.setGlobalEntityFunction(). This allows the entity processing code to quickly find matching entities within the entered text and to provide fuzzy matching capabilities if the exact entity was not entered.

If the set of entity values is not known, then you might have to write your own entityFunction to extract the entity value from the entered text according to your own rules (e.g., text within double-quotes).

iStooge commented 8 years ago

@jlpadilla and @JonHoughton: Thank you for your feedback! In my case I think I need to write my own entityFunction and just watch out for quotes. But I keep the fuzzyMatch in mind! Perheps it will fit one of the next scenarios. Thank you :)