Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report for the AMR model #7

Open
zhijing-jin opened this issue Aug 31, 2022 · 2 comments
Open

Bug report for the AMR model #7

zhijing-jin opened this issue Aug 31, 2022 · 2 comments

Comments

@zhijing-jin
Copy link

Hi thanks for making this wonderful package. Very user-friendly and easy to use!

I am using the AMR parsing function. And this post is to report that there are some failure cases, where the generated AMR is quite extreme:

sent = 'There are 300 masks / 10 masks/baggy = 30 baggies face masks.'
import elit
parser = elit.load(elit.pretrained.amr.AMR3_BART_LARGE_EN)
amr = parser(sent)
print(amr)

The generated AMR has thousands of variables, up to "x2000". And it seems to enter into a recurrent loop as follows:

(z1 / equal-01
    :ARG1 (z2 / product-of
              :op1 300
              :op2 10
              :op3 (z3 / product-of
                       :op1 (z4 / product-of
                                :op1 (z5 / product-of
                                         :op1 (z6 / product-of
                                                  :op1 (z7 / product-of
                                                           :op1 (z8 / product-of
                                                                    :op1 (z9 / product-of
                                                                             :op1 (z10 / product-of
                                                                                       :op1 (z11 / product-of
                                                                                                 :op1 (z12 / product-of
                                                                                                           :op1 (z13 / product-of

It's just a bug for your record.

@hankcs
Copy link
Collaborator

hankcs commented Sep 15, 2022

Hi @zhijing-jin , thanks for reporting this bug. It's probably due to the famous "text degeneration" problem of many seq2seq models. After 0dad49e is released, you can set beam_size=4, no_repeat_ngram_size=4 to mitigate it (probably tune no_repeat_ngram_size on some dev set).

parser(sent, beam_size=4, no_repeat_ngram_size=4)

(z1 / equal-01
    :ARG1 (z2 / product-of
              :op1 300
              :op2 10
              :op3 (z3 / baggy))
    :ARG2-of (z4 / equal-01
                 :ARG1 (z5 / mask
                           :mod (z6 / face)
                           :mod (z7 / baggie))))

Though the result is still not perfect, it looks better now.

@zhijing-jin
Copy link
Author

zhijing-jin commented Sep 15, 2022

Great, thank you! This is really helpful :)!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants