stog
stog copied to clipboard
penman.EncodeError: Invalid graph; possibly disconnected.
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.
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:
-
I had a white-space at the beginning of one of my amr-graphs. (in stog/data/AMR/
/data/amrs/split/dev/dev.txt) -
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))
Yes, I use the data generated by my model... so it may because the model generates something wrong. I will check it, thank you!