megagonlabs / coop

☘️ Code for Convex Aggregation for Opinion Summarization (Iso et al; Findings of EMNLP 2021)
https://aclanthology.org/2021.findings-emnlp.328v2.pdf
BSD 3-Clause "New" or "Revised" License
34 stars 9 forks source link

Error running evaluation command #4

Closed tomhosking closed 1 year ago

tomhosking commented 1 year ago

Hi,

The evaluation command provided in the readme doesn't quite work:

> python coop.search.py log/bimeanvae/space
python3: can't open file 'coop.search.py': [Errno 2] No such file or directory

Trying a few other variants also doesn't work:

> python -m coop.search.py log/bimeanvae/space
Traceback (most recent call last):
  File "/home/tom/miniconda3/envs/coop/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/tom/miniconda3/envs/coop/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/mnt/ext/phd/external/opagg/coop/coop/search.py", line 14, in <module>
    from models import Model
ImportError: cannot import name 'Model' from 'models' (unknown location)
> python coop/search.py log/bimeanvae/space
Traceback (most recent call last):
  File "coop/search.py", line 15, in <module>
    from reader import ReviewTest, OptimusTest
  File "/mnt/ext/phd/external/opagg/coop/coop/reader.py", line 10, in <module>
    from .tokenizer import Tokenizer
ImportError: attempted relative import with no known parent package

What's the correct way to run the evaluation script?

Thanks!

isomap commented 1 year ago

Hi Tom,

If I remember correctly, this script should work correctly if you clone this repo and run it under the root directory of this repo. So please make sure where to run this script.

Thanks!