opencog / relex

English Dependency Relationship Extractor

Home Page:http://wiki.opencog.org/w/RelEx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrongly treated LEFT-WALL as pronoun?

leungmanhin opened this issue · comments

When parsing a sentence The range of our voice ignores distance., some of the relex outputs doesn't seem correct... for example:

; pronoun-FLAG (you, T)
(InheritanceLink (stv 1.0 1.0)
   (WordInstanceNode "LEFT-WALL@sentence@ebcc86f4-8576-407a-872b-679ab6c11e59_parse_0")
   (DefinedLinguisticConceptNode "pronoun")
)
; gender (you, person)
(InheritanceLink (stv 1.0 1.0)
   (WordInstanceNode "LEFT-WALL@sentence@ebcc86f4-8576-407a-872b-679ab6c11e59_parse_0")
   (DefinedLinguisticConceptNode "person")
)
; definite-FLAG (you, T)
(InheritanceLink (stv 1.0 1.0)
   (WordInstanceNode "LEFT-WALL@sentence@ebcc86f4-8576-407a-872b-679ab6c11e59_parse_0")
   (DefinedLinguisticConceptNode "definite")
)
; pos (you, noun)
(PartOfSpeechLink (stv 1.0 1.0)
   (WordInstanceNode "LEFT-WALL@sentence@ebcc86f4-8576-407a-872b-679ab6c11e59_parse_0")
   (DefinedLinguisticConceptNode "noun")
)
; noun_number (you, singular)
(InheritanceLink (stv 1.0 1.0)
   (WordInstanceNode "LEFT-WALL@sentence@ebcc86f4-8576-407a-872b-679ab6c11e59_parse_0")
   (DefinedLinguisticConceptNode "singular")
)

Hmm. Interesting. I strongly suspect this is a side-effect of the ugly hack I made to get imperatives to work. You see, because Relex cannot add to or re-write parse trees, the only way I could force it to supply the subject of imperatives, e.g. " (You) Put down that knife, Eugene!" was to turn the left wall into the subject of the imperatives. That's why it is calling the left-wall "you" specifically. If this algorithm is being invoked it almost surely means that LG has classified "ignore" as an imperative, probably because it could not identify such a complex subject as "the rangeof our voice" as a subject. The root problems here are two: (1) that Relex cannot re-write the parse tree to add an unexpressed subject pronoun. (2) that it is difficult for LG to idenitify phrasal subjects, because it doesn't recognize the existence of phrase structure. I have been pressing Linas to work on these two short-comings for a year now, but of course, you can hack around them . . . .you should be able to find the guilty algorithm easily. Or add it to the list of things I will look into soon if my laptop can handle ubuntu .. . .

Aaron, I'm pretty sure the actual song title is "Careful with that ax,
Eugene".

Re: phrase structure: link-grammar has some nasty, ugly C code that creates
phrase structures from the LG parse. Its nasty because it handles lots of
special cases with raw C code, although some of the rules are
semi-extracted in a text file. It would be a good exercise for someone to
recreate those rules as just pure rules, applied e.g. in relex or in the
atomspace.

as to relex re-writing the parse-tree -- sure, it can.. The graph stored in
relex is completely generic, and you can write rules to add, remove or
replace any portion of the LG tree.

Once, during a long and boring lecture, I invented a way to add zero--that
and other zero words (e.g. the zero-subject you mention) in LG. It was
obvious, and I did not write it down, and of course now I completely forgot
and can't remember it. So I know its possible in a computationally
feasible way, just not sure how.

--linas

On Tue, Nov 10, 2015 at 7:39 PM, anitzkin notifications@github.com wrote:

Hmm. Interesting. I strongly suspect this is a side-effect of the ugly
hack I made to get imperatives to work. You see, because Relex cannot add
to or re-write parse trees, the only way I could force it to supply the
subject of imperatives, e.g. " (You) Put down that knife, Eugene!" was to
turn the left wall into the subject of the imperatives. That's why it is
calling the left-wall "you" specifically. If this algorithm is being
invoked it almost surely means that LG has classified "ignore" as an
imperative, probably because it could not identify such a complex subject
as "the rangeof our voice" as a subject. The root problems here are two:
(1) that Relex cannot re-write the parse tree to add an unexpressed subject
pronoun. (2) that it is difficult for LG to idenitify phrasal subjects,
because it doesn't recognize the existence of phrase structure. I have been
pressing Linas to work on these two short-comings for a year now, but of
course, you can hack around them . . . .you should be able to find the
guilty algorithm easily. Or add it to the list of things I will look into
soon if my laptop can handle ubuntu .. . .


Reply to this email directly or view it on GitHub
#231 (comment).

FYI:

  1. Yesterday, I fixed the crash in R2L that this caused. The fix was simple: stop using the pre- functions in the R2L rules.

  2. There is a general LG work item: add support for zero-copula, zero-that and a few oher zeros, which could be extended to zero-you in imperatives.

Support for this has been noted a LONG time in the LG README, I just opened a github issue to track this: opencog/link-grammar#224

Closing, this seems to be partly fixed, and the other unfixed(?) parts are too muddled to do something with.