Last active
August 21, 2025 03:39
-
-
Save kennethleungty/42c42027a009dbdf78fa498982a19f7e to your computer and use it in GitHub Desktop.
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
| import langextract as lx | |
| examples = [ | |
| lx.data.ExampleData( | |
| text="This policy does not cover damage caused by floods, earthquakes, or nuclear accidents.", | |
| extractions=[ | |
| lx.data.Extraction( | |
| extraction_class="exclusion", | |
| extraction_text="floods", | |
| attributes={ | |
| "plain_english": "Flood damage is not covered - you need separate flood insurance", | |
| }, | |
| ), | |
| lx.data.Extraction( | |
| extraction_class="exclusion", | |
| extraction_text="earthquakes", | |
| attributes={ | |
| "plain_english": "Earthquake damage is not covered - you need separate earthquake insurance", | |
| }, | |
| ), | |
| lx.data.Extraction( | |
| extraction_class="exclusion", | |
| extraction_text="nuclear accidents", | |
| attributes={ | |
| "plain_english": "Nuclear accident damage is not covered - you need separate nuclear accident insurance", | |
| } | |
| ), | |
| ] | |
| ), | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment