First: I’ve hooked up my Perplexity ERG engine to Alexa worldwide. If you have one, just say “open Perplexity Game”. Somehow using your voice to interact feels like a much cooler experience.
I’m working to improve errors. For example, if there is no green door and you say “go through the green door”, Perplexity currently responds with “there isn’t a door”. Very confusing if there is one and it just doesn’t happen to be green.
The problem is that the error is generated in the predication for
_door_n_1 in the first tree below. When executing that predicate, the only context it can add to the error is the variable
x9 (since that is all it is passed). Currently, I generate the error response by looking up what predication introduced that variable (i.e.
_door_n_1) and responding with “there isn’t a door”. Not a great error.
I really want to find a way to collect all the predications that are used to restrict
x9 and respond with that. In this case that would be
_door_n_1, which would generate the response “there isn’t a green door”, which is much better. Note that there are other predicates like
_through_p_dir that have
x9 as an argument, but aren’t restricting it, that I’d like to ignore.
A slightly more interesting example is at the bottom “go to the cave in the south”, where cave (
x9) is also being restricted by a locative preposition
_in_p_loc and used (but not restricted) by a directional preposition
_to_p_dir. I’m looking for rules that will help me include the first, but exclude the second.
Question: Are there any rules that I can use (even if they are just “it mostly works” type heuristics) for determining which predications are restricting an
x variable outside of “The predication that introduces the variable is restricting it”? Is there a way by telling from the argument signature? Or some other metadata? I am trying to avoid having to simply classify every predication by hand…
phrase: go through the green door ┌pron__x:x3 pronoun_q__xhh:x3,h5,h6┤ │ ┌_green_a_2__ex:e14,x9 │ ┌and┤ │ │ └_door_n_1__x:x9 └_the_q__xhh:x9,h11,h12┤ │ ┌_through_p_dir__eex:e8,e2,x9 └and┤ └_go_v_1__ex:e2,x3 Logic: pronoun_q__xhh(x3, pron__x(x3), _the_q__xhh(x9, and(_green_a_2__ex(e14, x9), _door_n_1__x(x9)), and(_through_p_dir__eex(e8, e2, x9), _go_v_1__ex(e2, x3))))
phrase: go to the cave in the south ┌pron__x:x3 pronoun_q__xhh:x3,h5,h6┤ │ ┌_south_n_of__xi:x15,i20 └_the_q__xhh:x15,h17,h18┤ │ ┌_cave_n_1__x:x9 │ ┌and┤ │ │ └_in_p_loc__exx:e14,x9,x15 └_the_q__xhh:x9,h11,h12┤ │ ┌_to_p_dir__eex:e8,e2,x9 └and┤ └_go_v_1__ex:e2,x3 Logic: pronoun_q__xhh(x3, pron__x(x3), _the_q__xhh(x15, _south_n_of__xi(x15, i20), _the_q__xhh(x9, and(_cave_n_1__x(x9), _in_p_loc__exx(e14, x9, x15)), and(_to_p_dir__eex(e8, e2, x9), _go_v_1__ex(e2, x3)))))