c-amr / camr

Transition-based tree-to-graph AMR Parser
GNU General Public License v2.0
125 stars 45 forks source link

Comment and instance have different length #12

Open fuzihaofzh opened 6 years ago

fuzihaofzh commented 6 years ago

I use

python amr_parsing.py -m preprocess --amrfmt amr data/del.txt

and get the following result:

Traceback (most recent call last):
  File "amr_parsing.py", line 436, in <module>
    main()
  File "amr_parsing.py", line 169, in main
    instances = preprocess(amr_file,START_SNLP=True,INPUT_AMR=args.amrfmt, PRP_FORMAT=args.prpfmt)
  File "/home/me/workbench/amr/camr/preprocessing.py", line 372, in preprocess
    _write_tok_amr(tok_amr_filename,amr_file,instances)
  File "/home/me/workbench/amr/camr/preprocessing.py", line 124, in _write_tok_amr
    output_tok.write(comment_list[i])
IndexError: list index out of range

I found that the sentence "Has history given us too many lessons?, 530, 412, 64" was splited into two sentence and thus has different number with the comment. Could you please tell me how to solve this issue?

ypuzikov commented 6 years ago

Stanford CoreNLP default.properties file contains properties for each of the annotators used. Set the ssplit.eolonly=true property in ./stanfordnlp/default.properties file. This will force CoreNLP to split sentences at newlines only.

See here: https://stanfordnlp.github.io/CoreNLP/ssplit.html