LoginSignup
0
0

More than 1 year has passed since last update.

Ubuntuにpyrougeをインストールする方法

Last updated at Posted at 2022-07-29

Ubuntuにpyrougeをインストールする方法を記述します。

git clone https://github.com/bheinzerling/pyrouge  # 今回インストールするpyrouge(perlで書かれたROUGE-1.5.5のラッパー)
git clone https://github.com/andersjo/pyrouge.git rouge  # ./rouge/tools/ROUGE-1.5.5がperlで書かれたROUGE-1.5.5であり、↑で利用する
cd pyrouge
pip install -e .
pyrouge_set_rouge_path /**absolute_path**/rouge/tools/ROUGE-1.5.5
python -m pyrouge.test

テストの結果
FAILED (errors=3)
となると思われるので、以下のように修正します。

cd ../rouge/tools/ROUGE-1.5.5/data/WordNet-2.0-Exceptions/
rm WordNet-2.0.exc.db # このファイルが存在する場合のみ
./buildExeptionDB.pl . exc WordNet-2.0.exc.db

cd ../
rm WordNet-2.0.exc.db # このファイルが存在する場合のみ
ln -s WordNet-2.0-Exceptions/WordNet-2.0.exc.db WordNet-2.0.exc.db

(参考: https://github.com/bheinzerling/pyrouge/issues/14#issuecomment-351642652)
これでテストのエラーが解消され、pyrougeが動くようになります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0