ibm-cloud-solutions / hubot-ibmcloud-cognitive-lib

Provides helper functions for configuring, storing, and processing information related to natural language processing of a statement
http://www.ibm.com/
Other
0 stars 0 forks source link

need to be able to specify and handle that a parameter may contain multiple words #9

Closed aeweidne closed 8 years ago

aeweidne commented 8 years ago

For the OpenWhisk NLC actions can contain spaces the parameter parsing does not handle this well see example below:

CHRISTOPHER HAMBRIDGE [3:47 PM]

@dilbertbot: show my openwhisk actions

dilbertbotBOT [3:47 PM]

[High confidence] Will process top class [openwhisk.action.list]

[3:47]

@chambrid: I will get your list of Openwhisk actions for space chambrid@us.ibm.com_dev.

[3:47]

@chambrid: Here is the list of actions for the chambrid@us.ibm.com_dev namespace.

[3:47]

My First Sequence Hello World With Params Hello World

@dilbertbot: invoke openwhisk action Hello World

dilbertbotBOT [3:47 PM]

[High confidence] Will process top class [openwhisk.action.invoke]

[3:47]

@chambrid: I will invoke your Openwhisk action World now.

[3:47]

@chambrid: Failed to invoke Openwhisk action World.

aeweidne commented 8 years ago

Note I have code as follows:

nlcconfig.updateGlobalParameterValues('IBMcloudOpenwhisk_action', actionNames); in the list actions command and the following in the NLC.json.

"parameter.values" : [
    {
        "name": "action",
        "values": []
    },
    {
        "name": "namespace",
        "values": []
    }
]

based on your info in the meeting today I "feel" like we should have the necessary data to extract a multiple word action after we have run the list actions command.

aeweidne commented 8 years ago

I agree. I 'Hello World' was in the list .... it should have worked.

I saw an odd problem in my testing that was similar. At the time it seemed related to the nlcconfig.updateGlobalParameterValues() not consistently working.

In the unit tests it always seems to work. However, in the real bot it seems as though there are issues in which one package sets the values and then the cognitive processing does not see them. I will see if we can isolate this for @nbarker to help investigate.

JonHoughton commented 8 years ago

Hopefully the new hubot-ibmcloud-cognitive-entities package and the new behavior have reduced the likelihood of problems with spaces. In the case of parameters with an entityfunction specified and registered, entities with blanks should now be found.

In particular, openwhisk actions with spaces should now work.

The problem could still occur for entities in which the entityfunction is not specified. This is a relatively rare case now. There is also not a very good solution for the problem. It is not at all clear when we should choose 'Hello', 'World' or 'Hello World' as a parameter value.

I suggest tabling this issue until we determine it is still an issue since any solution would be very risky.

chambrid commented 8 years ago

Closing due to above. Will reopen as needed.