gabrielStanovsky / unified-factuality

Code, data and models for the paper "Integrating Deep Linguistic Features in Factuality Prediction over Unified Datasets" (Stanovsky, Eckle-Kohler, Puzikov, Dagan and Gurevych ACL 2017)
MIT License
7 stars 0 forks source link

FactBank key error in ddict_get() #23

Closed njjiang closed 5 years ago

njjiang commented 5 years ago

I received the following error when trying to run convert_factbank.sh on the current version of FactBank:

Traceback (most recent call last):
  File "./readers.py", line 654, in <module>
    os.path.join(inp_, "tokens_tml.txt"))
  File "./readers.py", line 136, in __init__
    self.conll_txt = self.convert(tokens_tml)
  File "./readers.py", line 210, in convert
    value = self.consolidate_fact_value(fn, sent_id, tmlTagId)
  File "./readers.py", line 176, in consolidate_fact_value
    [filename, sent_number, entity_id])
  File "./readers.py", line 618, in ddict_get
    cur = cur[k]
KeyError: 0

It seems to be triggered by the first line in tokens_tml.txt

'ABC19980108.1830.0711.tml'|||0|||0|||'ABC19980108'|||'TIMEX3'|||'t82'|||'B'

I realized this is probably due to different versions of FactBank, because many other lines in tokens_tml.txt would trigger this error:

'ABC19980108.1830.0711.tml'|||0|||0|||'ABC19980108'|||'TIMEX3'|||'t82'|||'B'
'ABC19980108.1830.0711.tml'|||0|||1|||'.1830.0711'|||''|||''|||''
'ABC19980108.1830.0711.tml'|||1|||0|||'On'|||''|||''|||''
'ABC19980108.1830.0711.tml'|||1|||1|||'the'|||''|||''|||''
'ABC19980108.1830.0711.tml'|||1|||2|||'other'|||''|||''|||''
'ABC19980108.1830.0711.tml'|||1|||3|||'hand'|||''|||''|||''
'ABC19980108.1830.0711.tml'|||1|||4|||','|||''|||''|||''
'ABC19980108.1830.0711.tml'|||1|||5|||'it'|||''|||''|||''
....

Is there a workaround for this?

gabrielStanovsky commented 5 years ago

Hi @njjiang following our talk today, can you please send me an email at gabriel.satanovsky@gmail.com I'll also make sure to fix this issue in the upcoming week. Thanks!

gabrielStanovsky commented 5 years ago

This issue stems from a new version of factbank. For now, the original scripts work for v1. I'm deferring handling following versions of factbank, since I don't have them, but It'd be great if someone who does ports them over :)