-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Util functions to print output from a pipeline #1374
Comments
Hi Haystack team, anyone can shed some lights to the question? Many thanks. |
Hi @predoctech I will look into this issue later today and will start by reproducing your error message. If you have some code ready to share we can speed up the process a bit. Did you maybe work with a jupyter notebook or some other code snippet that you could share? I would expect the Ranker to return a list of Document. Line 143 that you are referring to is this line here, correct? Line 143 in c3d8aa0
|
@predoctech I think the problem is that the returned type is Document but the type expected by print_documents() is a dictionary.
I took it from here haystack/haystack/classifier/farm.py Line 45 in 4e6f7f3
For your information, we are working on refactoring Document and other primitives in #1232 |
@julian-risch Thanks for the suggestion. Your code does seem to take care of the type problem, but print_documents() make reference to a key "name" inside the meta dict of "res" which does not exist. Following is the error dump, any suggestion? |
The haystack/haystack/preprocessor/utils.py Line 267 in 1c8a03a
or a line of code that does that when evaluation data is loaded: haystack/haystack/preprocessor/utils.py Line 120 in 1c8a03a
If your documents don't have a name, I would suggest that you implement a slightly different version of Does that solve your problem for now? For the sake of completeness, there are two other options that I see: 1) we could modify the print_documents() method so that it checks whether the key |
Hi @predoctech have you found a solution for your problem? |
Well sort of @julian-risch. |
Okay, I understand. As mentioned before we are working on refactoring Document and other primitives in #1232 and this refactoring should simplify interfaces between pipeline nodes, how to pass on documents and how to print documents. Stay tuned! |
Question
In deploying a SentenceTransformersRanker and re-ranking the predictions from a FAQPipeline, what would be the suitable utils function to print the results? It seems like labels in the returned dictionary has been changed and print_answers is no longer suitable. I tried using print_documents but it broke saying that:
"TypeError: 'Document' object is not subscriptable" on line 143
Additional context
Add any other context or screenshots about the question (optional).
FAQ Check
Followed the documents and github issues on the usage of SentenceTransformersRanker but there is no mention of the suitable utils for printing out the corresponding result.
The text was updated successfully, but these errors were encountered: