Errors installing Pyrouge

筅森魡賤 提交于 2019-12-12 02:57:48

问题


I'm currently trying to install pyrouge, and I'm getting the following errors

======================================================================
ERROR: test_options (pyrouge.tests.Rouge155_test.PyrougeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/Rouge155_test.py", line 218, in test_options
    pyrouge_output = check_output_clean(pyrouge_command)
  File "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/Rouge155_test.py", line 17, in <lambda>
    check_output_clean = lambda c: check_output(c).decode("UTF-8").strip()
  File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: test_write_config (pyrouge.tests.Rouge155_test.PyrougeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/Rouge155_test.py", line 197, in test_write_config
    check_output(command.split())
  File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

----------------------------------------------------------------------

I'm running Ubuntu, and I have installed XML::DOM using the synaptic package installer.

Additionally, I have ran the pyrouge_set_rouge_path.py command and have directed it to my ROUGE directory. I have used sudo for all my installations.


回答1:


In Rouge155_test.py file, you should modify two lines:

modify

"pyrouge_evaluate_plain_text_files.py -m {} -s {} -sfp "

to

"pyrouge_evaluate_plain_text_files -m {} -s {} -sfp "

And, modify

"pyrouge_write_config_file.py -m {m} -s {s} " 

to

"pyrouge_write_config_file -m {m} -s {s} " 


来源:https://stackoverflow.com/questions/35835842/errors-installing-pyrouge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!