yanaiela / TNE

codebase for the Text-based NP Enrichment (TNE) paper
MIT License
19 stars 5 forks source link

No module named 'bridging' #2

Open jinzhao3611 opened 2 years ago

jinzhao3611 commented 2 years ago

Hi, the importing of the extra package 'bridging' (include-package parameter) failed when I try to get the predictions file using the model that was released. I wasn't able to find useful information on bridging module either. Can I get some help? Thanks! Following is the error message:

$ allennlp predict models/coupled_spanbert_large/coupled_spanbert_large.tar.gz data/test_unlabeled.jsonl --output-file coupled_large_predictions.jsonl --include-package bridging --use-dataset-reader --predictor tne_predictor
2022-09-16 12:17:28,497 - INFO - allennlp.common.plugins - Plugin allennlp_models available
Traceback (most recent call last):
  File "/home/jz/anaconda3/envs/tne/bin/allennlp", line 8, in <module>
    sys.exit(run())
  File "/home/jz/anaconda3/envs/tne/lib/python3.7/site-packages/allennlp/__main__.py", line 34, in run
    main(prog="allennlp")
  File "/home/jz/anaconda3/envs/tne/lib/python3.7/site-packages/allennlp/commands/__init__.py", line 120, in main
    import_module_and_submodules(package_name)
  File "/home/jz/anaconda3/envs/tne/lib/python3.7/site-packages/allennlp/common/util.py", line 349, in import_module_and_submodules
    module = importlib.import_module(package_name)
  File "/home/jz/anaconda3/envs/tne/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bridging'
yanaiela commented 2 years ago

Hey, Thanks for your interest!

I'm sorry about that. There were some transitions I did from the previous naming of the project (bridging). The correct command should use tne as the argument for the include-package command, and not bridging (which was the old name).

The following command should work:

$allennlp predict models/coupled_spanbert_large/model.tar.gz data/test_unlabeled.jsonl --output-file coupled_large_predictions.jsonl --include-package tne --use-dataset-reader --predictor tne_predictor (I also updated the README)

Let me know if it works for you.