snipsco / snips-nlu

Snips Python library to extract meaning from text
https://snips-nlu.readthedocs.io
Apache License 2.0
3.89k stars 513 forks source link

example of implicit entities with json format? #834

Closed timtutt closed 5 years ago

timtutt commented 5 years ago

I noticed in the documentation there is a way to assign an implicit entity and slot using the .yml format. Is this possible with the json format? If so, can you provide an example?

adrienball commented 5 years ago

Hi @timtutt , The Implicit entity values and slot mapping feature is a YAML-only feature which is only there to make the task of annotating easier. Basically, it consists in reducing the amount of user-provided information to the strict minimum. For instance, if one utterance is labelled using [my_slot:my_entity] then we know that the slot my_slot corresponds to the entity my_entity and this mapping applies for all utterances so you can just use [my_slot] in all the other utterances.

So far we have made the choice of a strict format for the JSON dataset as it is not really supposed to be generated manually. Of course, this can evolve.

Can you share a bit your use case, or just simply how you would leverage this feature if it existed ? Thanks!

timtutt commented 5 years ago

@adrienball - thanks much for the response here.

This was actually a misunderstanding on my part - I was under the assumption this feature would at run time impute and "extract" default/implicit entities for a given intent when those entities are not explicitly provided.

Right now I handle this with business logic outside of snips... For example:

Example "When was the temperature the hottest?" or "What day was the hottest" and "What month was the temperature the hottest"

These all map to the same intent, but having snips automatically identify missing slots for that intent would be valuable. That said I've gotten around this by implementing in business logic.