Add require_grounding parameter to filter ungrounded extractions#327
Add require_grounding parameter to filter ungrounded extractions#327ryankSD wants to merge 5 commits intogoogle:mainfrom
Conversation
Fixes google#209 When require_grounding=True, extractions that cannot be located in the source text (char_interval is None) are filtered out. This prevents returning extractions from few-shot examples. - Add _filter_ungrounded_extractions() helper function - Add require_grounding parameter to extract() (default False) - Add unit tests for filtering behavior
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
1 similar comment
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 2 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
Fixes #209
Description
LangExtract extracts content from few-shot examples instead of just the input document. These hallucinated extractions have
char_interval: Nonebecause they can't be located in the source text.This PR adds a
require_groundingparameter toextract()that filters out extractions wherechar_intervalisNone.How Has This Been Tested?
tests/test_require_grounding.pyChecklist