stog icon indicating copy to clipboard operation
stog copied to clipboard

penman.EncodeError: Invalid graph; possibly disconnected.

Open QAQ-v opened this issue 5 years ago • 2 comments

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.

QAQ-v avatar Nov 06 '19 03:11 QAQ-v

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))

SimonWesterlind avatar Nov 07 '19 10:11 SimonWesterlind

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

QAQ-v avatar Nov 07 '19 12:11 QAQ-v