openeventdata / UniversalPetrarch

Language-agnostic political event coding using universal dependencies
MIT License
18 stars 9 forks source link

reading parsed articles error : 'sent_id' referenced before assignment #21

Closed khaledJabr closed 6 years ago

khaledJabr commented 6 years ago

I have been working with this parsed file on Universal Petrarch. When I run Petrarch on it, it fails on reading the file, and gives this error:

Traceback (most recent call last):
  File "petrarch_ud.py", line 471, in <module>
    main()
  File "petrarch_ud.py", line 81, in main
    run(paths, out , True)  ## <===
  File "petrarch_ud.py", line 423, in run
    events = PETRreader.read_xml_input(filepaths, s_parsed)
  File "...../UniversalPetrarch/PETRreader.py", line 2373, in read_xml_input
    holding[entry_id]['sents'][sent_id] = sent_dict
UnboundLocalError: local variable 'sent_id' referenced before assignment

I am suspecting this issue has to do with duplicate sentence/story id's, but I am not 100% sure. What I am currently doing is skipping those which cause this issue and it seems to be working.

JingL1014 commented 6 years ago

yes, this error is due to the duplicated entry_id in the input file. I fixed the errors.