Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordNet-2.0.exc.db error. #8

Closed
eduOS opened this issue Jul 19, 2017 · 3 comments
Closed

WordNet-2.0.exc.db error. #8

eduOS opened this issue Jul 19, 2017 · 3 comments

Comments

@eduOS
Copy link

eduOS commented Jul 19, 2017

I get stuck by this error for two days,,,

2017-07-19 11:57:28,358 [MainThread  ] [INFO ]  Set ROUGE home directory to /home/eduOS/software/ROUGE-1.5.5.
Cannot open exception db file for reading: /home/eduOS/software/ROUGE-1.5.5/data/WordNet-2.0.exc.db
Traceback (most recent call last):
  File "cal_rouge.py", line 53, in <module>
    results_dict = rouge_eval(rd, dd)
  File "cal_rouge.py", line 22, in rouge_eval
    rouge_results = r.convert_and_evaluate()
  File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/Rouge155.py", line 364, in convert_and_evaluate
    rouge_output = self.evaluate(system_id, rouge_args)
  File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/Rouge155.py", line 339, in evaluate
    rouge_output = check_output(command).decode("UTF-8")
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'/home/eduOS/software/ROUGE-1.5.5/ROUGE-1.5.5.pl', '-e', '/home/eduOS/software/ROUGE-1.5.5/data', '-c', '95', '-2', '-1', '-U', '-r', '1000', '-n', '4', '-w', '1.2', '-a', u'-m', u'/tmp/tmpmV_cZG/rouge_conf.xml']' returned non-zero exit status 2

And I have also tried the pyrouge from andersjo, but its API is different. How can I tackle this problem? What's going on here? I have tried to delete the file but cannot find it there.

@eduOS
Copy link
Author

eduOS commented Jul 19, 2017

And here is the test error:

ERROR: test_rouge_for_plain_text (pyrouge.tests.Rouge155_test.PyrougeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/tests/Rouge155_test.py", line 173, in test_rouge_for_plain_text
    pyrouge_output = check_output_clean(pyrouge_command.split())
  File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/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 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '[u'pyrouge_evaluate_plain_text_files', u'-m', u'data/models_plain', u'-s', u'data/systems_plain', u'-sfp', u'D(\\d+).M.100.T.A', u'-mfp', u'D#ID#.M.100.T.[A-Z]', u'-id', u'1']' returned non-zero exit status 1

----------------------------------------------------------------------
Ran 11 tests in 1.435s

FAILED (errors=3)

@eduOS
Copy link
Author

eduOS commented Jul 19, 2017

I solved it after reading this article, which reads that:

Error Handling

If you encounter following error message when you use pythonrouge

Cannot open exception db file for reading: /home/pythonrouge/pythonrouge/RELEASE-1.5.5/data/WordNet-2.0.exc.db

you can run pythonrouge by doing following.

cd pythonrouge/RELEASE-1.5.5/data/
rm WordNet-2.0.exc.db
./WordNet-2.0-Exceptions/buildExeptionDB.pl ./WordNet-2.0-Exceptions ./smart_common_words.txt ./WordNet-2.0.exc.db

I just run the command to generate the db file.

./WordNet-2.0-Exceptions/buildExeptionDB.pl ./WordNet-2.0-Exceptions ./smart_common_words.txt ./WordNet-2.0.exc.db

Under the data directory.

@eduOS eduOS closed this as completed Jul 19, 2017
@Franck-Dernoncourt
Copy link

Or, if on Microsoft Windows:

Remove RELEASE-1.5.5\data\WordNet-2.0.exc.db, then from cmd.exe:

cd RELEASE-1.5.5\data\
perl WordNet-2.0-Exceptions/buildExeptionDB.pl ./WordNet-2.0-Exceptions ./smart_common_words.txt ./WordNet-2.0.exc.db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants