I try to post Intent and entity via wit.ai HTTP API.
My JSON format:
{"entities"=>[{"id"=>"intent", "lookups"=>["trait"], "values"=> [{"value"=>"ask_info", "expressions"=>["How old are you ?"]}]}, {"id"=>"age", "values"=>[{"value"=>"old", "expressions"=>["How old are you ?"]}]}]}
Input sentence is "How old are you ?"
Intent is ask_info
Entity is age for value 'old'
I call post entitiles API twice for Intent and Entity
$ curl -XPOST 'https://api.wit.ai/entities?v=20160526' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"id"=>"intent", "lookups"=>["trait"], "values"=> [{"value"=>"ask_info", "expressions"=>["How old are you ?"]}]}'
$ curl -XPOST 'https://api.wit.ai/entities?v=20160526' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"id"=>"age", "values"=>[{"value"=>"old", "expressions"=>["How old are you ?"]}]}'
In wit.ai page, entity age not mapping to expression "How old are you ?". Just display in Synonyms Display Image
Downloaded Dataset only show intent no entity
{ "text" : "How old are you ?", "entities" : [ { "entity" : "intent", "value" : "\"ask_info\"" } ] }
wit.ai GUI work very nice
{ "text" : "How old are you ?", "entities" : [ { "entity" : "intent", "value" : "\"ask_info\"" }, { "entity" : "age", "value" : "\"old\"", "start" : 2, "end" : 3 } ] }
Do you have any method could solve this problem?
I've bypassed this bug by manually crafting an archive which I later used for deploy.
There are multiple issues with this approach:
The upside is multiple features that are not available in the API are exposed, such as setting the 'free-text' lookups option.
I've downloaded an sample application and proceeded from there.