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

BUG: Retriever format not matching what reader is expecting #74

Closed
mansilla opened this issue Apr 26, 2020 · 1 comment
Closed

BUG: Retriever format not matching what reader is expecting #74

mansilla opened this issue Apr 26, 2020 · 1 comment

Comments

@mansilla
Copy link

Hello, first of all. Thank you for this wonderful project.
So, I'm following this tutorial here. But I'm having the following error:

Traceback (most recent call last):
  File "haystack_test.py", line 46, in <module>
    prediction = finder.get_answers(question="What is the mass of the electron?", top_k_retriever=10, top_k_reader=5)
  File "/Users/admin/miniconda3/envs/legy/lib/python3.6/site-packages/haystack/finder.py", line 55, in get_answers
    len_chars = sum([len(d.text) for d in documents])
  File "/Users/admin/miniconda3/envs/legy/lib/python3.6/site-packages/haystack/finder.py", line 55, in <listcomp>
    len_chars = sum([len(d.text) for d in documents])
AttributeError: 'list' object has no attribute 'text'

That line is actually only for printing info. But if I skip that, below in the same file haystack/finder.py, in line 61 the reader is invoked with the same documents objects and throws an error:

Traceback (most recent call last):
  File "haystack_test.py", line 46, in <module>
    prediction = finder.get_answers(question="What is the mass of the electron?", top_k_retriever=10, top_k_reader=5)
  File "/Users/admin/miniconda3/envs/legy/lib/python3.6/site-packages/haystack/finder.py", line 61, in get_answers
    top_k=top_k_reader)
  File "/Users/admin/miniconda3/envs/legy/lib/python3.6/site-packages/haystack/reader/farm.py", line 221, in predict
    "text": doc.text,
AttributeError: 'list' object has no attribute 'text'

So my conclusion is the format the reader is expecting is different from what the retriever is returning.

NOTE: I installed the library from GitHub as recommended in the Readme file.

@mansilla
Copy link
Author

Closing since is the same as #68

masci pushed a commit that referenced this issue Nov 27, 2023
fix: handle falsy node I/O properly
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

1 participant