-
Notifications
You must be signed in to change notification settings - Fork 13
feat: enhance augment prompt to detect disguised identifiers #207
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -670,6 +670,24 @@ def _get_augment_prompt(*, data_summary: str | None, labels: list[str], strict_l | |
|
|
||
| <<EXAMPLE_BLOCK>> | ||
|
|
||
| Additional extraction requirements: | ||
| - The "value" field must be the EXACT verbatim span from the input text. | ||
| Copy the text character-for-character exactly as it appears. | ||
| Do NOT normalize, correct spelling, expand abbreviations, decode encodings, | ||
| infer hidden values, translate text, reformat numbers, or otherwise modify | ||
| the extracted span. | ||
| - Extract only text that is explicitly present in the input. | ||
| Never reconstruct, guess, or generate a value that does not appear verbatim. | ||
| - Identifiers may be disguised, fragmented, hyphenated, misspelled, obfuscated, | ||
| spaced out, mixed with punctuation, or written in words instead of digits. | ||
| Detect the identifier and extract the exact text as written. | ||
| Examples of disguised identifiers to detect: | ||
| - Phone numbers, SSNs, and credit card numbers spoken as digit words, | ||
| including "o" or "oh" used in place of zero: | ||
| "nine o two, five five five, one two three four" | ||
| - Names spelled out letter by letter with hyphens or commas: | ||
| "J-O-H-N", "M, A, R, Y" | ||
|
|
||
|
Comment on lines
+673
to
+690
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Standard few-shot prompting places all instructions before the demonstrations so the example can illustrate those instructions. Here, "Additional extraction requirements" appears after Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's good the way it is. |
||
| --- | ||
| Input text: <<TAGGED_TEXT>> | ||
| Already-detected entities: <<SEED_ENTITIES>> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.