mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-07 20:46:31 +00:00
Fix document_name for TFIDF retriever (#33)
This commit is contained in:
parent
a0cfd16b0c
commit
f1a9dad24f
@ -42,9 +42,9 @@ class Finder:
|
||||
|
||||
# Add corresponding document_name if an answer contains the document_id (only supported in FARMReader)
|
||||
for ans in results["answers"]:
|
||||
document_name = next(
|
||||
(meta["document_name"] for meta in meta_data if meta["document_id"] == ans["document_id"]), None
|
||||
)
|
||||
ans["document_name"] = document_name
|
||||
ans["document_name"] = None
|
||||
for meta in meta_data:
|
||||
if meta["document_id"] == ans["document_id"]:
|
||||
ans["document_name"] = meta.get("document_name", None)
|
||||
|
||||
return results
|
||||
Loading…
x
Reference in New Issue
Block a user