2017-08-26 196 views
1

我想在Ubuntu中安裝pyrouge以進行文本摘要評估。我使用this中的說明。安裝pyrouge在ubuntu中得到錯誤

首先我寫了pip install pyrouge然後我必須寫這個命令:pyrouge_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory

在我的系統上寫道:

pyrouge_set_rouge_path /home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyrouge 

,並得到這個:

Exception: Cannot set data directory because the path /home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyrouge/data does not exist.

pyrouge_set_rouge_path /home/afsharizadeh/pyrouge-0.1.0/pyrouge 

,並得到這個:

Exception: Cannot set data directory because the path /home/afsharizadeh/pyrouge-0.1.0/pyrouge/data does not exist.

pyrouge_set_rouge_path /home/afsharizadeh/pyrouge-0.1.0/pyrouge/test 

,並得到這個:

Exception: ROUGE binary not found at /home/afsharizadeh/pyrouge-0.1.0/pyrouge/test/ROUGE-1.5.5.pl. Please set the correct path by running pyrouge_set_rouge_path /path/to/rouge/home.

我知道這個問題類似的問題,被要求在堆棧溢出,但我不能解決我的問題,因爲我不知道在所有這個表達「ROUGE路徑」是什麼意思。 「通向ROUGE-1.5.5」的含義是什麼?

我知道我有兩個關於pyrouge的目錄。其中之一是這個路徑:~/anaconda3/lib/python3.6/site-packages/pyrouge另一個是我從網站下載它的目錄。這條路是:~/pyrouge-0.1.0。這個目錄有三個其他的目錄名稱:bin,pyrouge,pyrouge.egg-info。

基於this page我在這個格式寫道:

set pyrouge_set_rouge_path=/home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyroug 

這種格式後,沒有出現任何錯誤,但是當我型後:

python -m pyrouge.test 

我得到這個錯誤:

Exception: Cannot set data directory because the path /home/afsharizadeh/anaconda3/lib/python3.6/site-packages/pyroug/data does not exist.

---------------------------------------------------------------------- Ran 11 tests in 0.592s

FAILED (errors=9)

我該怎麼辦?

回答

1

使用最新版本的pyrouge在this link,問題解決了。 爲此,我代替這些代碼:

pip install pyrouge 
pyrouge_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory 
python -m pyrouge.test 

有:

git clone https://github.com/bheinzerling/pyrouge 
cd pyrouge 
python setup.py installt 
python -m pyrouge.test 
在此之後

,每一件事情是好的和測試後,我得到這個消息的成功:

Ran 11 tests in 6.322s 
OK