-
Notifications
You must be signed in to change notification settings - Fork 13
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: Metadata extractor update #147
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 12256963475Details
💛 - Coveralls |
sjrl
requested review from
anakin87 and
davidsbatista
and removed request for
a team and
anakin87
December 9, 2024 15:02
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.
Looks very good - just left a few minor comments/checks
haystack_experimental/components/extractors/llm_metadata_extractor.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/extractors/llm_metadata_extractor.py
Outdated
Show resolved
Hide resolved
haystack_experimental/components/extractors/llm_metadata_extractor.py
Outdated
Show resolved
Hide resolved
…ctor.py Co-authored-by: David S. Batista <[email protected]>
…ctor.py Co-authored-by: David S. Batista <[email protected]>
…ctor.py Co-authored-by: David S. Batista <[email protected]>
davidsbatista
approved these changes
Dec 10, 2024
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
Updates to the LLM Metadata Extractor.
Proposed Changes:
Output Changes:
documents
which contains all documents that succeeded in metadata extraction andfailed_documents
which contains all documents that failed (either because the LLM could not be executed or a JSON parsing error). By having this separation it's easy to use thefailed_documents
directly in another LLM metadata extractor to try and fix the issue especially if the error is related to JSON parsing.Prompt Changes
document
. This way we can utilize all the info contained within a document as well. E.g. I can usedocument.content
to print out the contents and then also usedocument.meta.XX
to print out any relevant meta information as well (e.g. file name) into the prompt instructions.Se/de
from_dict
method of all the different LLM Providers. So instead we need to create a custom from_dict method that can optionally handle all the different edge cases.Other
expected_keys
optional since it's not always alarming if not all expected keys are filled. Sometimes documents won't contain relevant info to extract so instead it can be passed optionally. If passed now it will only print a warning message if there are missing (or additionally unexpected keys).How did you test it?
Added a lot of new tests
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.