opencog / relex

English Dependency Relationship Extractor

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"John and Mary eat." vs "John and Mary walk."

williampma opened this issue · comments

For "John and Mary eat." parse 1 I get the correct

    _subj(eat, John)
    _subj(eat, Mary)
    conj_and(John, Mary)

but for "John and Mary walk." parse 1 I get

    conj_and(John, walk)
    _nn(walk, Mary)

the correct parse is at parse 3 instead. How come? Is this happening for anyone else?

because "walk" can be a noun, but "eat" can only be verb...

Ruiting Lian

On Thu, Sep 18, 2014 at 11:50 AM, William Ma notifications@github.com
wrote:

For "John and Mary eat." parse 1 I get the correct

_subj(eat, John)
_subj(eat, Mary)
conj_and(John, Mary)

but for "John and Mary walk." parse 1 I get

conj_and(John, walk)
_nn(walk, Mary)

the correct parse is at parse 3 instead. How come?


Reply to this email directly or view it on GitHub
#169.

for "John and Mary walk."
conj_and(john, walk)
_amod(walk, mary)

i am using link-grammar 5.1.0

@amebel that can't be right.

linkparser> John and Mary eat
Found 2 linkages (2 had no P.P. violations)
    Linkage 1, cost vector = (UNUSED=0 DIS= 0.00 LEN=9)

    +------------>WV------------>+
    +-------Wd------+-----Spx----+
    |        +-SJls-+--SJrs-+    |
    |        |      |       |    |
LEFT-WALL John.m and.j-n Mary.b eat 

But

linkparser> John and Mary walk
Found 6 linkages (6 had no P.P. violations)
    Linkage 1, cost vector = (UNUSED=0 DIS= 0.00 LEN=9)

    +------------->WV------------->+
    +-------Wd------+------Spx-----+
    |        +-SJls-+--SJrs-+      |
    |        |      |       |      |
LEFT-WALL John.m and.j-n Mary.b walk.v 

Press RETURN for the next linkage.
linkparser> 
    Linkage 2, cost vector = (UNUSED=0 DIS= 0.10 LEN=6)

    +-------Wa------+-----SJrs-----+
    |        +-SJls-+       +--AN--+
    |        |      |       |      |
LEFT-WALL John.m and.j-n Mary.b walk.n 

Press RETURN for the next linkage.

Observe that the first linkage has a cost DIS=0, and the second one has a cost DIS=0.1 Its the second one that is giving you the amod. The first one should not give you an amod.

If the first one is coming out second, its because relex is using ints not floats for cost.... and indeed, that is the cse. So relex is broken for cost. Ill try to fix that now.

OK, turns out when LG changed from int-values costs to double-costs, I forgot to change the Java API, which is still using ints.

I just fixed that now. This will be in LG version 5.1.1 which I will try to publish in the next few days or maybe week.

The cost fix is now in both link-grammar 5.1.1 or newer, and also in relex.

"John and Mary walk" still returns

    conj_and(John, walk)
    _nn(walk, Mary)

as parse 1, which is why I never closed this. Must be something different on my machine only?

Do you have at least link-grammar-5.1.1 and the latest relex? FWWIW 5.2.1 came out today.

I was using 5.2.0. Updated to 5.2.1 and same thing.

However, I noticed something strange. If I tell RelEx to return only one parse, it returns the correct one

    _subj(walk, John)
    _subj(walk, Mary)
    conj_and(John, Mary)

If I tell RelEx to return more than one parse, then the first one is incorrect. Looks like some bugs on the RelEx parse sorting side.

Ahh! OK, I know what that is... I'll fix it.

On Mon, Dec 29, 2014 at 8:38 PM, William Ma notifications@github.com
wrote:

I was using 5.2.0. Updated to 5.2.1 and same thing.

However, I noticed something strange. If I tell RelEx to return only one
parse, it returns the correct one

_subj(walk, John)
_subj(walk, Mary)
conj_and(John, Mary)

If I tell RelEx to return more than one parse, then the first one is
incorrect. Looks like some bugs on the RelEx parse sorting side.


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

OK, this push fixes it
9a1c742

I should have made it a pull request. Sorry.