CogComp / summary-cloze

Summary Cloze: A New Task for Content Selection in Topic-Focused Summarization
Apache License 2.0
6 stars 0 forks source link

ModuleNotFoundError: No module named 'summarize' #2

Open IreneZihuiLi opened 3 years ago

IreneZihuiLi commented 3 years ago

Hi,

Thanks for sharing the pretrained model! I am using 0.9.0 version of AllenNLP, but I was running something like this:

allennlp predict \
--include-package summarize \
--predictor cloze-extractive-predictor \
--overrides '{"dataset_reader.max_num_sentences": null, "model.max_words": null, "model.max_sents": 1}' \
--output-file test.wikicite.jsonl \
https://danieldeutsch.s3.amazonaws.com/summarize/experiments/deutsch2019/v1.1/extractive-step/extractive-model/model/topics/no-context/model.tar.gz myoutput.jsonl

Then this is what I got:

2021-11-12 12:48:00,749 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
Traceback (most recent call last):
  File "/home/lily/zl379/anaconda2/envs/wikicite/bin/allennlp", line 8, in <module>
    sys.exit(run())
  File "/home/lily/zl379/anaconda2/envs/wikicite/lib/python3.8/site-packages/allennlp/run.py", line 18, in run
    main(prog="allennlp")
  File "/home/lily/zl379/anaconda2/envs/wikicite/lib/python3.8/site-packages/allennlp/commands/__init__.py", line 101, in main
    import_submodules(package_name)
  File "/home/lily/zl379/anaconda2/envs/wikicite/lib/python3.8/site-packages/allennlp/common/util.py", line 323, in import_submodules
    module = importlib.import_module(package_name)
  File "/home/lily/zl379/anaconda2/envs/wikicite/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'summarize'

I could not get the AllenNLP with your model working, I am not sure if the error is from AllenNLP or your model. Thanks.

danieldeutsch commented 3 years ago

Are you running the predict command from the root of the repository? AllenNLP should be able to import the package from there. Are you able to manually import it yourself?