Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting AttributeError: 'list' object has no attribute 'values' at doc_coref.values() #62

Open
nurub-tech opened this issue Mar 21, 2021 · 2 comments

Comments

@nurub-tech
Copy link

Describe the bug
Running the same code in the example parse_single_from_code.py and got this errors output
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.752.0_x64__qbz5n2kfra8p0\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "C:\Users\nurub\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\Giveme5W1H\extractor\extractor.py", line 20, in run
extractor.process(document)
File "C:\Users\nurub\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\Giveme5W1H\extractor\extractors\abs_extractor.py", line 41, in process
self._evaluate_candidates(document)
File "C:\Users\nurub\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\Giveme5W1H\extractor\extractors\action_extractor.py", line 108, in _evaluate_candidates
if any(doc_coref.values()):
AttributeError: 'list' object has no attribute 'values'

I opened action_extractor.py and added a these 3 prints before the 1st if in function _evaluate_candidates, to see its content
print( 'doc_len = ', doc_len, '\n' )
print( 'doc_ner = ', doc_ner, '\n' )
print( 'doc_coref = ', doc_coref, '\n' )

The result is
doc_len = 0
doc_ner = []
doc_coref = []

It shows that doc_coref is an array and not a dictionary and hence it doesn't have an attribute .values()

To Reproduce
Run the example on windows 10

Expected behavior
document.get_corefs() returns an array and not a dictionary

Versions (please complete the following information):

  • OS: Windows 10
  • Python 3.9
  • Giveme5W1H Version [e.g. 1.2]
  • Stanford CoreNLP Version
@imohitmayank
Copy link

Facing the same issue on Ubuntu 18.04 and Python 3.6.9

@TitasDas
Copy link

Try the solution in #43 by installing jdk 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants