snipsco / snips-issues

Feel free to share your bugs with us.
14 stars 5 forks source link

[Support] NLU training error intent contains invalid entity #100

Closed Martin1887 closed 5 years ago

Martin1887 commented 5 years ago

Hello.

I have having issues with an app in Snips that some months ago when I created it was working fine.

When I try to install an assistant that contains this app I get the following error:

NLU training(node:6360) UnhandledPromiseRejectionWarning: Error: {"status":"error","message":"bad request: [intent_44WP6O6eVB] contains invalid entity"}
    at /usr/lib/node_modules/snips-sam/node_modules/wretch/dist/bundle/wretch.js:1:4771
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:6360) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6360) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

In addition, when I add this app to the Snips console, all queries tried to this app are not recognised, and if I logout and login again, Snips console says that the assistant must be retrained but it don't permit to retrain it.

The intent of the error is the first intent of the app, but I suggest that all intents will crash because all are similar. I think that the problem is in Unicode characters in slot type (because it is the most extrange thing I find and Python uses to have problems with Unicode).

The app that have these issues is called 'Meteorología' (Spanish language) and the intent name is 'buscarPronosticoDeTemperatura' (id intent_44WP6O6eVB). This app is based in the action OWN.

Thanks and Regards.

Martin1887 commented 5 years ago

Hello.

This is the response of the Retrain assistant button in the console:

[{"data":{"trainAssistant":null},"errors":[{"message":"{\"status\":400,\"message\":{\"status\":\"error\",\"message\":\"bad request: [intent_44WP6O6eVB] contains invalid entity\"}}","locations":[{"line":2,"column":3}],"path":["trainAssistant"]}]}]

Regards.

pocketjoso commented 5 years ago

Hi @Martin1887. For slot types (known as entities by the platform), these limits exist:

Can you check if you are over these limits in any of your custom slot types used in this intent?

It's a bit hard to learn what's wrong in this case, this is on us. We're about to add more UI info about this.

Martin1887 commented 5 years ago

Hello @pocketjoso.

Effectively, the intents had a slot type with all OWM possible cities, more than 50K.

I have changed the slot type to Snips default, but I wonder how much can decrease the precision of the locations matching (in fact, it is now detecting now the locations).

A hint about the maximum possible values for slot types would be really helpful.

Any advice to find a tradeoff?

Thanks and Regards.

adrienball commented 5 years ago

Hi @Martin1887 , You don't have to fallback to snips default for the slot type, you can just limit the number of values to be < 50K. Then, if you want Snips to recognize values outside of the list, you must enable the Automatically extensible option in the custom slot type configuration. If you provide enough training utterances, with sufficient diversity with regards to the patterns, the NLU should be able to capture cities outside of the list.

I hope this helps, Cheers

cpoisson commented 5 years ago

Closing this one for clean up.