dwadden / dygiepp

Span-based system for named entity, relation, and event extraction.
MIT License
569 stars 120 forks source link

TypeError: CorefResolver.make_output_human_readable: return type `None` is not a `typing.Dict[str, torch.Tensor]`. #125

Open ecust-sl opened 3 months ago

ecust-sl commented 3 months ago

2024-05-22 22:40:16,174 - INFO - allennlp.common.plugins - Plugin allennlp_models available Traceback (most recent call last): File "/home/shilei/anaconda3/envs/R2GenRL/bin/allennlp", line 8, in sys.exit(run()) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/allennlp/main.py", line 39, in run main(prog="allennlp") File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/allennlp/commands/init.py", line 119, in main import_module_and_submodules(package_name) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/allennlp/common/util.py", line 376, in import_module_and_submodules import_module_and_submodules(subpackage, exclude=exclude) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/allennlp/common/util.py", line 359, in import_module_and_submodules module = importlib.import_module(package_name) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/data/init.py", line 1, in from dygie.data.dataset_readers.dygie import DyGIEReader File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/data/dataset_readers/dygie.py", line 19, in from dygie.data.dataset_readers.document import Document, Sentence File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/data/dataset_readers/document.py", line 3, in from dygie.models.shared import fields_to_batches, batches_to_fields File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/models/init.py", line 1, in from dygie.models.dygie import DyGIE File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/models/dygie.py", line 17, in from dygie.models.coref import CorefResolver File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/models/coref.py", line 24, in class CorefResolver(Model): File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/dygie/models/coref.py", line 388, in CorefResolver def make_output_human_readable(self, output_dict: Dict[str, torch.Tensor]): File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/overrides/overrides.py", line 83, in overrides return _overrides(method, check_signature, check_at_runtime) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/overrides/overrides.py", line 172, in _overrides _validate_method(method, super_class, check_signature) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/overrides/overrides.py", line 191, in _validate_method ensure_signature_is_compatible(super_method, method, is_static) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/overrides/signature.py", line 103, in ensure_signature_is_compatible ensure_return_type_compatibility(super_type_hints, sub_type_hints, method_name) File "/home/shilei/anaconda3/envs/R2GenRL/lib/python3.9/site-packages/overrides/signature.py", line 303, in ensure_return_type_compatibility raise TypeError( TypeError: CorefResolver.make_output_human_readable: return type None is not a typing.Dict[str, torch.Tensor].

dwadden commented 3 months ago

To debug, can you please identify a minimal example that produces this output and share in the issue?