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

penman.EncodeError: Invalid graph; possibly disconnected. #12

Open
QAQ-v opened this issue Nov 6, 2019 · 2 comments
Open

penman.EncodeError: Invalid graph; possibly disconnected. #12

QAQ-v opened this issue Nov 6, 2019 · 2 comments

Comments

@QAQ-v
Copy link

QAQ-v commented Nov 6, 2019

Hi,

during prediction I met this error, have you met it before?

File "/home/yaosw/anaconda3/envs/stog/lib/python3.6/site-packages/penman.py", line 250, in encode
return self._encode_penman(g, top=top)
File "/home/yaosw/anaconda3/envs/stog/lib/python3.6/site-packages/penman.py", line 493, in _encode_penman
raise EncodeError('Invalid graph; possibly disconnected.')
penman.EncodeError: Invalid graph; possibly disconnected.

@SimonWesterlind
Copy link

SimonWesterlind commented Nov 7, 2019

Hi! I do think I recall encountering this error about a week back.

As stated it is about the format of the AMR-graph. Are you using your own dataset? I think my error arose from these two reasons:

  1. I had a white-space at the beginning of one of my amr-graphs. (in stog/data/AMR//data/amrs/split/dev/dev.txt)

  2. I had an amr-graph with more than one root/top/head. E.g.
    Incorrect:

(g / give-01
      :ARG1 (e / email-address-entity)
      :ARG2 (i / i))
(p / person :name (n / name :op1 "Allan" :op2 "Rickman")
      :poss-of e)

Correct:

(g / give-01
      :ARG1 (e / email-address-entity
            :poss (p / person :name (n / name :op1 "Allan" :op2 "Rickman")))
      :ARG2 (i / i))

@QAQ-v
Copy link
Author

QAQ-v commented Nov 7, 2019

Yes, I use the data generated by my model... so it may because the model generates something wrong. I will check it, thank you!

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