You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed the summ_eval package using pip and also tried to run it locally by cloning it. I encountered several issues and here are the fixes that helped me get this running. I am putting them here for anyone who might face a similar issue or if the team is interested to update them directly into the code.
It would be a great help if these issues could be addressed directly inside the package. I would love to pull this work into my current project :)
Setting-up Rouge Metric inside summ_eval:
If you have installed summ_eval using pip. You might have gotten errors while loading the RougeMetric() asking to do pip install -U git+https://github.com/bheinzerling/pyrouge.git again and again.
On the windows machine, we have to change a few commands. I would recommend the pythonic way as it is platform-independent. We need to change the following lines after the line subprocess.run(["tar", "-xzf", "project.tar.gz"]) :
File ..\summ_eval\summa_qa_metric.py: Add from sys import stderr
While evaluating super_metric I encountered an error in file utils.py. The error says {ModuleNotFound}No module named 'sentence_transformers' this occurs because it is trying to import a package named as sentence_transformers which is not present in the packages, however, that is inside the summ_eval package hence we want to import the relative package.
I updated the line from importlib.import_module(module_path) to importlib.import_module(f"{__name__.split('.')[0]}.{module_path}") which is results inimportlib.import_module('summ_eval.sentence_transformers.models') .
import_module can take a relative path if we mention the source package. You can check out this link https://stackoverflow.com/a/10675081 for more info.
Missing requirements:
scikit-learn==0.23.2 , I was getting an error for sklearn since it was not installed. Not sure about the exact version by I installed 0.23.2
If setting up by cloning the repository (On Windows)
Pre-requisite:
On windows machine:
Perl should be installed
To check if it is installed correctly try the below command on terminal/command prompt
Make sure the following paths are present in PATH/Path variable:
C:\Strawberry\perl\bin
C:\Strawberry\perl\site\bin
C:\Strawberry\c\bin
Open ..\pyrouge\Rouge155.py (or wherever you installed pyrouge), go to the function def evaluate(self, system_id=1, rouge_args=None) (it's at line 322at the time I am writing this), and add
command.insert(0, 'perl ') right before self.log.info("Running ROUGE with command {}".format(" ".join(command))).
Alternatively it can be changed to check_output(command, env=env, shell=True).decode("UTF-8"). (If you don't do it, you'll get OSError: [WinError 193] %1 is not a valid Win32 application.
Installations and Modifications:
[Optional] Mark evaluation & summ_eval folders as the source directories (those who are using pycharm).
install pyrouge manually: pip install pyrouge, default version 0.1.3
Modify the evaluation/summ_eval/rouge_metric.py file:
UpdateRouge155(rouge_dir=rouge_dir, rouge_args=rouge_args, log_level=log_level) to Rouge155(rouge_dir=rouge_dir, rouge_args=rouge_args) since log_level is not needed here and causes error.
Add this to environment path for running file (if using pycharm)
Hi Team,
I installed the summ_eval package using pip and also tried to run it locally by cloning it. I encountered several issues and here are the fixes that helped me get this running. I am putting them here for anyone who might face a similar issue or if the team is interested to update them directly into the code.
It would be a great help if these issues could be addressed directly inside the package. I would love to pull this work into my current project :)
Setting-up Rouge Metric inside summ_eval:
If you have installed summ_eval using pip. You might have gotten errors while loading the RougeMetric() asking to do
pip install -U git+https://github.com/bheinzerling/pyrouge.git
again and again.On the windows machine, we have to change a few commands. I would recommend the pythonic way as it is platform-independent. We need to change the following lines after the line
subprocess.run(["tar", "-xzf", "project.tar.gz"])
:Installation & Modifications:
..\summ_eval\summa_qa_metric.py:
Addfrom sys import stderr
utils.py
. The error says{ModuleNotFound}No module named 'sentence_transformers'
this occurs because it is trying to import a package named assentence_transformers
which is not present in the packages, however, that is inside thesumm_eval
package hence we want to import the relative package.importlib.import_module(module_path)
toimportlib.import_module(f"{__name__.split('.')[0]}.{module_path}")
which is results inimportlib.import_module('summ_eval.sentence_transformers.models')
.import_module
can take a relative path if we mention the source package. You can check out this link https://stackoverflow.com/a/10675081 for more info.scikit-learn==0.23.2
, I was getting an error forsklearn
since it was not installed. Not sure about the exact version by I installed0.23.2
If setting up by cloning the repository (On Windows)
Pre-requisite:
On windows machine:
Perl should be installed
To check if it is installed correctly try the below command on terminal/command prompt
if ftype doesn't work we can set it:
If you have installed strawberry Perl you might need to copy
libexpat-1__.dll
file :C:\Strawberry\c\bin\libexpat-1__.dll
toC:\Strawberry\perl\vendor\lib\auto\XML\Parser\Expat\libexpat-1__.dll
Check the registry:
Computer\HKEY_CLASSES_ROOT\Perl_program_file\shell\Execute Perl Program\command
C:\Strawberry\perl\bin\perl.exe "%1" %*
Environment Variables:
PATH/Path
variable:C:\Strawberry\perl\bin
C:\Strawberry\perl\site\bin
C:\Strawberry\c\bin
Open
..\pyrouge\Rouge155.py
(or wherever you installedpyrouge
), go to the functiondef evaluate(self, system_id=1, rouge_args=None)
(it's at line 322at the time I am writing this), and addcommand.insert(0, 'perl ')
right beforeself.log.info("Running ROUGE with command {}".format(" ".join(command)))
.check_output(command, env=env, shell=True).decode("UTF-8")
. (If you don't do it, you'll getOSError: [WinError 193] %1 is not a valid Win32 application
.Installations and Modifications:
pip install pyrouge
, default version0.1.3
evaluation/summ_eval/rouge_metric.py
file:Rouge155(rouge_dir=rouge_dir, rouge_args=rouge_args, log_level=log_level)
toRouge155(rouge_dir=rouge_dir, rouge_args=rouge_args)
since log_level is not needed here and causes error.ROUGE_HOME=..path\to\your\project\SummEval\evaluation\summ_eval\ROUGE-1.5.5/
Helpful Links
The text was updated successfully, but these errors were encountered: