bjascob / amrlib

A python library that makes AMR parsing, generation and visualization simple.
MIT License
216 stars 33 forks source link

What is the meaning of the alignment result? #24

Closed zhaozj89 closed 2 years ago

zhaozj89 commented 2 years ago

Hi, thanks for this work. I am trying to understand the alignment result of FAA. For example,

    # ::status ParsedStatus.OK
    # ::source QA-pairs-first-round_ali-baba-and-forty-thieves-story_1.txt
    # ::nsent 6
    # ::snt building on their father 's business -
    (z0 / build-01
        :location (z1 / business
                      :poss (z2 / person
                                :ARG0-of (z3 / have-rel-role-91
                                             :ARG1 (z4 / they)
                                             :ARG2 (z5 / father)))))

The corresponding alignment result is:

   0-1 1-1.1.r 5-1.1 4-1.1.1.r 2-1.1.1.1.1 3-1.1.1.1.2 

I know the left in left-right denotes the left-th token in the source sentence :snt. For right, does 1 denote root node? 1.1 denotes the first child of the root node? What is the meaning of r in 1.1.r? Thanks.

bjascob commented 2 years ago

The system outputs in the "ISI" alignment format. There's a copy of the description in this project here (see (2) under Explanation).

Yes, n-1 denotes the root node and n-1.1 is the first sub-amr of the root node. The suffix .r designates the role (aka edge) of a sub-amr. Looks to me like your example sentence connects like...

building   --> (z0 / build-01)
on         --> :location   
business   --> (z1 / business)
's         --> :poss 
their      --> (z4 / they)
father     --> (z5 / father)
zhaozj89 commented 2 years ago

Thanks for the help!