Use json-repair package to fix LLM generated json#226
Merged
willtai merged 8 commits intoneo4j:mainfrom Dec 10, 2024
Merged
Conversation
2ddf3ed to
dc1101d
Compare
stellasia
reviewed
Dec 7, 2024
src/neo4j_graphrag/experimental/components/entity_relation_extractor.py
Outdated
Show resolved
Hide resolved
tests/unit/experimental/components/test_entity_relation_extractor.py
Outdated
Show resolved
Hide resolved
c1ef1d6 to
fadde05
Compare
stellasia
reviewed
Dec 9, 2024
src/neo4j_graphrag/experimental/components/entity_relation_extractor.py
Outdated
Show resolved
Hide resolved
src/neo4j_graphrag/experimental/components/entity_relation_extractor.py
Outdated
Show resolved
Hide resolved
tests/unit/experimental/components/test_entity_relation_extractor.py
Outdated
Show resolved
Hide resolved
alexthomas93
reviewed
Dec 9, 2024
bf68808 to
20572c8
Compare
63e26cc to
84ac45a
Compare
639cae2 to
0a629af
Compare
0a629af to
801c3d9
Compare
Contributor
Author
|
@CodiumAI-Agent /update_changelog |
|
Changelog updates: 🔄 2024-12-10Added
Changed
|
ac75669 to
9a0a3f3
Compare
|
Changelog updates: 🔄 2024-12-10Added
Changed
|
15 tasks
This file contains hidden or 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
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.
Description
This PR improves on fixing LLM-generated JSON objects for the EntityRelationExtractor with the following:
json-repairpackage to fix LLM generated JSON objects.The previous function to clean up LLM generated JSON objects is now removed.
This was tested using several LLMs using Ollama. During testing, the prompt and model temperature were changed to encourage the LLM to generate invalid JSON. These outputs were used to validate the new methods.
Type of Change
Complexity
Complexity: Low
How Has This Been Tested?
Checklist
The following requirements should have been met (depending on the changes in the branch):