I'm modifying the Haystack tutorial notebook to make a basic extractive QA system. Everything works great, but now I want to link each answer back to its original .txt file.
When printing the predicted answers with pprint, each answer has an attribute document_ids
that looks like this: 'document_ids': ['c4711696aa2c81c609932143da711ea3']
. This helps link back to the right Document
object from the DocumentStore
, and the Document
objects have a 'meta' attribute that looks like the right place to store the original file name.
How can I edit this notebook to save the file name with each Document
in the DocumentStore
?