sempre icon indicating copy to clipboard operation
sempre copied to clipboard

ContextFn support for mixed-depth nodes?

Open krivard opened this issue 6 years ago • 0 comments

Hi, I'm hoping to use ContextFn similarly to the anaphora rule for 'he' in the documentation, but pulling out a non-leaf logical form that apparently has children of nonuniform depth.

The context exchange looks like this:

(exchange (exchange harriet (call edu.cmu.lia.semparse.ReferenceQuery.generate 
(string OBJECT) (string pk=32)) (string OBJECT[pk=32])))

& I would take either a solution for

 (string OBJECT[pk=32])

or for

(call edu.cmu.lia.semparse.ReferenceQuery.generate (string OBJECT) (string pk=32))

The documentation suggests a rule like this would work:

(rule $CATEGORY (he) (ContextFn (depth 0) (type fb:type.text)))

...but, alas, no luck. I've also tried depth 1 and depth 2, with no success. Some digging and print statements suggest that my first preference ((string ...) is never investigated, and my second preference ((call ...) can never be selected because it has two leaf children of depth 1 and four leaf children of depth 2.

What's the intended behavior of the depth restriction -- are higher-level nodes meant to be completely symmetrical in depth, or would it be alright to replace that currentLevel == depth with currentLevel <= depth?

krivard avatar Oct 11 '18 20:10 krivard