stanford-oval/genie-cloud

Bad grammar if the canonical form starts with "a"

gcampax opened this issue · 0 comments

In case the query is not a list query, it's appropriate to use "a" instead of "the" in front of the canonical form: "get a random number" instead of "get the random number".

Currently, we don't handle "a random number" as canonical form, and we generate "get the a random number".
We should postprocess and grammar fix.

Log:

====
# main/723c1651-e531-4d0a-a0fd-f76d0191e91c
#! timestamp: 2021-08-03T19:18:21.961Z
U: find a random number between 100 and 500
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100)
C: #[results=[
C:   { random=211, high=500, low=100 }
C: ]];
#! timestamp: 2021-08-03T19:18:22.296Z
A: 211.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_display_result;
#! timestamp: 2021-08-03T19:18:25.136Z
U: another one
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100)
C: #[results=[
C:   { random=211, high=500, low=100 }
C: ]];
C: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100)
C: #[results=[
C:   { random=447, high=500, low=100 }
C: ]];
#! timestamp: 2021-08-03T19:18:27.800Z
A: Did you mean get the a random number between 100 and 500?
A: 447.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_display_result;
#! timestamp: 2021-08-03T19:18:51.262Z
U: cancel
UT: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100)
C: #[results=[
C:   { random=211, high=500, low=100 }
C: ]];
C: @org.thingpedia.builtin.thingengine.builtin.get_random_between(high=500, low=100)
C: #[results=[
C:   { random=447, high=500, low=100 }
C: ]];
#! timestamp: 2021-08-03T19:18:51.280Z
A: Alright, let me know if I can help you with anything else!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_end;