swabhs / open-sesame

A frame-semantic parsing system based on a softmax-margin SegRNN.
Apache License 2.0
229 stars 65 forks source link

Got an Error while Running a Basic Prediction Task #53

Closed heeh closed 4 years ago

heeh commented 4 years ago

Hello, thank you for the great program. I was trying to predict a sample sentence.

Hoover Dam played a major role in preventing Las Vegas from drying up.

I saved this sentence on sample.txt and execute the following command.

$ python -m sesame.frameid --mode predict \
                           --model_name fn1.7-pretrained-frameid \
                           --raw_input sample.txt

However, I got the following error.

Reading logs/example.txt ...
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/open-sesame/sesame/frameid.py", line 110, in <module>
    instances, _, _ = read_conll(options.raw_input)
  File "/open-sesame/sesame/dataio.py", line 73, in read_conll
    elements.append(CoNLL09Element(l, read_depsyn))
  File "/open-sesame/sesame/conll09.py", line 40, in __init__
    self.id = int(ele[0])
ValueError: invalid literal for int() with base 10: 'Hoover Dam played a major role in preventing Las Vegas from drying up.'

Did I miss any steps?

heeh commented 4 years ago

Nevermind, I figured it out. The .txt input is meant for targetid prediction