-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: Add document page number of ExtractedAnswer to meta #7572
Conversation
Pull Request Test Coverage Report for Build 8923598800Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
meta_to_add = {} | ||
if answer.document and "page_number" in answer.document.meta: | ||
ans_start = answer.document_offset.start | ||
answer_page_number = answer.document.meta["page_number"] + answer.document.content[:ans_start].count("\f") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a heads up @julian-risch there is no component in Haystack v2 that would add the page_number
key to document.meta
. Please see this issue #6705
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet!
Related Issues
ExtractedAnswer
missingpage_number
meta #7570Proposed Changes:
"answer_page_number"
How did you test it?
tests are still missingRan all ExtractiveReader tests locallywe need to check whether the document's meta contains page number#7599 adds page numbers to metaNotes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.