-
Notifications
You must be signed in to change notification settings - Fork 56.7k
Add insurance AI use case examples #1056
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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| def summarize_claim(claim_text): | ||
| """ | ||
| Summarize an insurance claim into key facts. | ||
| """ | ||
| # Split and clean sentences | ||
| sentences = [s.strip() for s in claim_text.split(".") if s.strip()] | ||
| # Take the first two sentences | ||
| summary = ". ".join(sentences[:2]) + "." | ||
| return summary | ||
|
Comment on lines
+1
to
+9
|
||
|
|
||
| # Step 2: Example claim document | ||
| claim_document = "On December 10th, 2025, Mr. Ade filed a motor accident claim. His Toyota Corolla was rear-ended at a traffic light in Lagos. The estimated repair cost is ₦1,200,000. No injuries were reported." | ||
|
|
||
|
|
||
| # Step 3: Run the summarizer | ||
| print("Original Claim Document:") | ||
| print(claim_document) | ||
| print("\nAI-Generated Summary:") | ||
| print(summarize_claim(claim_document)) | ||
|
Comment on lines
+1
to
+19
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||
| # Generative AI in Nigerian Insurance | ||||||
|
|
||||||
| Generative AI can help insurance companies improve efficiency, reduce fraud, and enhance customer service. | ||||||
|
||||||
| Generative AI can help insurance companies improve efficiency, reduce fraud, and enhance customer service. | |
| Generative AI can help insurance companies improve efficiency, reduce fraud, and enhance customer service. |
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.
The summarize_claim function has a bug: it naively splits by periods without considering periods in abbreviations, numbers, or other contexts. For example, if a claim mentions "Dr. Smith" or "123.45", these would be incorrectly split. Consider using more robust sentence tokenization methods from libraries like nltk or spaCy, or at minimum, handle common edge cases like titles (Mr., Dr., etc.) and decimal numbers.