Open ghost opened 7 years ago
pyrouge uses the tempfile module to create temorary files. You can set the default directory for tempfile like this, before running pyrouge:
import tempfile
tempfile.tempdir = "/some/temp/path"
Alternatively, you can set the TMPDIR, TEMP or TMP environment variables in your operating system.
Thanks for your answer! But I wonder which version of python should I use? I run pyrouge_evaluate_plain_text_files
but got this error:
Traceback (most recent call last):
File "pyrouge_evaluate_plain_text_files", line 25, in <module>
main()
File "pyrouge_evaluate_plain_text_files", line 21, in main
output = rouge.convert_and_evaluate(args.system_id, args.split_sents)
File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/Rouge155.py", line 367, 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 337, in evaluate
self.write_config(system_id=system_id)
File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/Rouge155.py", line 321, in write_config
self._config_file, system_id)
File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/Rouge155.py", line 293, in write_config_static
model_dir, model_filenames)
File "/usr/local/lib/python2.7/dist-packages/pyrouge-0.1.3-py2.7.egg/pyrouge/Rouge155.py", line 451, in __get_eval_string
for i, name in enumerate(model_filenames)]
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte
Please make sure that your input files are UTF-8. I looks like you're trying to open a file with windows-1252/cp1252 encoding.
@bheinzerling But they are just file names instead of file content. Aren't they?
I also have same problem,but I can do with part of my files.And come to 152 files,it show that errors.
I am running this code in a docker container, which has not enough space left. Seems that it would store all the files under the path
/tmp/
. Could you please tell me how to set this path myself? Thanks in advance!