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

Decoding error #17

Closed
nguyenlab opened this issue Jul 19, 2017 · 4 comments
Closed

Decoding error #17

nguyenlab opened this issue Jul 19, 2017 · 4 comments

Comments

@nguyenlab
Copy link

nguyenlab commented Jul 19, 2017

I am running penman with output from an AMR parser. It outputs ":null_edge (x20 / 876-9))))))"
Hence, penman cannot decode it because of the relation "null_edge".
I replace the underscore with a minus then it can be solved.

I am not sure whether "null_edge" violates the annotation of penman or the decoder can not recognize this pattern?

Many thanks

@goodmami
Copy link
Owner

goodmami commented Jul 19, 2017

Hi, thanks for the bug report. I'm having trouble reproducing. Can you fill in a few details:

  • Penman version (release version or commit hash)
  • Whether you used penman.decode(), penman.AMRCodec().decode(), or something else
  • The full input

I'm finding that the problem is the hyphen in the concept rather than the underscore in the relation. Sometimes the error messages from the penman module don't accurately point to the source of the error.

Here is what I see, both in the development version and release v0.6.1. First, with AMRCodec:

>>> penman.AMRCodec().decode('(a / blah :null_edge (x20 / 876-9))')
Traceback (most recent call last):
[...]
penman.DecodeError: Expected ":" or "/" at position 31
>>> penman.AMRCodec().decode('(a / blah :null-edge (x20 / 876-9))')
Traceback (most recent call last):
[...]
penman.DecodeError: Expected ":" or "/" at position 31
>>> penman.AMRCodec().decode('(a / blah :null_edge (x20 / 8769))')
<Graph object (top=a) at 140002126592336>

Then with the default codec:

>>> penman.decode('(a / blah :null_edge (x20 / 876-9))')
Traceback (most recent call last):
[...]
penman.DecodeError: Expected ":" or "/" at position 31
>>> penman.decode('(a / blah :null-edge (x20 / 876-9))')
Traceback (most recent call last):
[...]
penman.DecodeError: Expected ":" or "/" at position 31
>>> penman.decode('(a / blah :null_edge (x20 / 8769))')
<Graph object (top=a) at 140002126592208>

I would expect the original graph to parse with the default codec. Investigating this allowed me to see a possible bug in the AMRCodec, though, that is overly restrictive on concept parsing.

@goodmami
Copy link
Owner

I believe this is fixed in the latest develop version. It fixes parsing of 876-9 as a node type (concept). I didn't do anything about null_edge because it didn't cause any problems for me.
Can you please check?

@riyajatar37003
Copy link

riyajatar37003 commented Sep 10, 2024

DecodeError: Expected: LPAREN

here is text where it thows error: DART ("Data Access for Responsible Testing")
how can solve this issue, is there any way i can bypass this and is there any impact on output if i bypass this

@goodmami
Copy link
Owner

Hi @riyajatar37003, please open a new issue with a minimal working example, including the exact string you're trying to parse.

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

3 participants