BDR-AI commited on
Commit
8fe17cb
·
verified ·
1 Parent(s): 5cb4c8e

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +116 -276
app.py CHANGED
@@ -1,317 +1,157 @@
1
  """
2
  GCC Insurance AI Hub
3
- Central hub linking all insurance AI demonstration repositories.
4
  """
5
 
6
  import gradio as gr
7
 
8
- # Repository information
9
- REPOS = {
10
- "insurance-datasets-synthetic": {
11
- "title": "📊 Insurance Datasets (Synthetic)",
12
- "description": "Synthetic insurance datasets for claims, policies, and fraud indicators",
13
- "url": "https://huggingface.co/spaces/YOUR_USERNAME/insurance-datasets-synthetic",
14
- "features": [
15
- "3 synthetic CSV datasets",
16
- "Claims data with amounts and dates",
17
- "Policy information",
18
- "Fraud indicators",
19
- "Interactive data viewer",
20
- "Download capabilities"
21
- ],
22
- "use_cases": [
23
- "Testing and development",
24
- "Training and education",
25
- "Prototyping analytics",
26
- "Demo applications"
27
- ]
28
- },
29
- "fraud-triage-sandbox": {
30
- "title": "🔍 Fraud Triage Sandbox",
31
- "description": "Rule-based fraud detection and claim triage demonstration",
32
- "url": "https://huggingface.co/spaces/YOUR_USERNAME/fraud-triage-sandbox",
33
- "features": [
34
- "Interactive claim input",
35
- "Rule-based fraud detection",
36
- "Risk scoring system",
37
- "Triage recommendations",
38
- "Configurable thresholds",
39
- "Detailed explanations"
40
- ],
41
- "use_cases": [
42
- "Understanding fraud detection",
43
- "Testing triage logic",
44
- "Training claims adjusters",
45
- "Workflow prototyping"
46
- ]
47
- },
48
- "ifrs-claim-accrual-estimator": {
49
- "title": "📈 IFRS 17 Claim Accrual Estimator",
50
- "description": "Actuarial reserve estimation under IFRS 17 principles",
51
- "url": "https://huggingface.co/spaces/YOUR_USERNAME/ifrs-claim-accrual-estimator",
52
- "features": [
53
- "Chain ladder method",
54
- "Risk adjustment calculation",
55
- "Present value discounting",
56
- "Complete accrual breakdown",
57
- "Multiple claim types",
58
- "Interactive parameters"
59
- ],
60
- "use_cases": [
61
- "Learning IFRS 17 concepts",
62
- "Understanding actuarial methods",
63
- "Reserve estimation demos",
64
- "Accounting training"
65
- ]
66
- },
67
- "doc-rag-compliance-assistant": {
68
- "title": "📚 Document RAG Compliance Assistant",
69
- "description": "Retrieval-Augmented Generation for compliance Q&A",
70
- "url": "https://huggingface.co/spaces/YOUR_USERNAME/doc-rag-compliance-assistant",
71
- "features": [
72
- "Document retrieval",
73
- "Answer generation",
74
- "Source transparency",
75
- "Multiple compliance topics",
76
- "Natural language queries",
77
- "Relevance scoring"
78
- ],
79
- "use_cases": [
80
- "Compliance Q&A",
81
- "Policy guidance",
82
- "Training and education",
83
- "Knowledge management"
84
- ]
85
- }
86
- }
87
-
88
  # Create Gradio interface
89
  with gr.Blocks(title="GCC Insurance AI Hub", theme=gr.themes.Soft()) as demo:
90
  gr.Markdown("""
91
- # 🏢 GCC Insurance AI Hub
92
 
93
- Welcome to the **GCC Insurance AI Demonstration Hub** - your central access point for insurance AI tools and datasets.
94
 
95
- ## 🎯 Purpose
96
 
97
- This hub provides access to a collection of **demonstration tools** for insurance operations, including:
98
- - Synthetic datasets for testing
99
- - Fraud detection systems
100
- - Actuarial calculations
101
- - Compliance assistance
102
 
103
- ⚠️ **Important**: All tools use **synthetic data** and are for **demonstration purposes only**.
104
 
105
- ---
106
- """)
 
 
 
107
 
108
- # Repository 1: Datasets
109
- with gr.Accordion("📊 Insurance Datasets (Synthetic)", open=True):
110
- gr.Markdown(f"""
111
- ### {REPOS['insurance-datasets-synthetic']['title']}
112
-
113
- {REPOS['insurance-datasets-synthetic']['description']}
114
-
115
- **Features:**
116
- {chr(10).join(['- ' + f for f in REPOS['insurance-datasets-synthetic']['features']])}
117
-
118
- **Use Cases:**
119
- {chr(10).join(['- ' + u for u in REPOS['insurance-datasets-synthetic']['use_cases']])}
120
-
121
- **Access:** [Open Repository]({REPOS['insurance-datasets-synthetic']['url']})
122
- """)
123
 
124
- # Repository 2: Fraud Triage
125
- with gr.Accordion("🔍 Fraud Triage Sandbox", open=False):
126
- gr.Markdown(f"""
127
- ### {REPOS['fraud-triage-sandbox']['title']}
128
-
129
- {REPOS['fraud-triage-sandbox']['description']}
130
-
131
- **Features:**
132
- {chr(10).join(['- ' + f for f in REPOS['fraud-triage-sandbox']['features']])}
133
-
134
- **Use Cases:**
135
- {chr(10).join(['- ' + u for u in REPOS['fraud-triage-sandbox']['use_cases']])}
136
-
137
- **Access:** [Open Repository]({REPOS['fraud-triage-sandbox']['url']})
138
- """)
139
 
140
- # Repository 3: IFRS Estimator
141
- with gr.Accordion("📈 IFRS 17 Claim Accrual Estimator", open=False):
142
- gr.Markdown(f"""
143
- ### {REPOS['ifrs-claim-accrual-estimator']['title']}
144
-
145
- {REPOS['ifrs-claim-accrual-estimator']['description']}
146
-
147
- **Features:**
148
- {chr(10).join(['- ' + f for f in REPOS['ifrs-claim-accrual-estimator']['features']])}
149
-
150
- **Use Cases:**
151
- {chr(10).join(['- ' + u for u in REPOS['ifrs-claim-accrual-estimator']['use_cases']])}
152
-
153
- **Access:** [Open Repository]({REPOS['ifrs-claim-accrual-estimator']['url']})
154
- """)
155
 
156
- # Repository 4: RAG Assistant
157
- with gr.Accordion("📚 Document RAG Compliance Assistant", open=False):
158
- gr.Markdown(f"""
159
- ### {REPOS['doc-rag-compliance-assistant']['title']}
160
-
161
- {REPOS['doc-rag-compliance-assistant']['description']}
162
-
163
- **Features:**
164
- {chr(10).join(['- ' + f for f in REPOS['doc-rag-compliance-assistant']['features']])}
165
-
166
- **Use Cases:**
167
- {chr(10).join(['- ' + u for u in REPOS['doc-rag-compliance-assistant']['use_cases']])}
168
-
169
- **Access:** [Open Repository]({REPOS['doc-rag-compliance-assistant']['url']})
170
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  gr.Markdown("""
173
  ---
174
 
175
- ## 🛠Technology Stack
176
-
177
- All repositories are built with:
178
- - **Framework**: Gradio for interactive interfaces
179
- - **Language**: Python 3.9+
180
- - **Libraries**: pandas, numpy for data processing
181
- - **Deployment**: Hugging Face Spaces
182
-
183
- ## 📋 Repository Overview
184
-
185
- | Repository | Type | Primary Function |
186
- |------------|------|------------------|
187
- | **Insurance Datasets** | Data | Synthetic datasets for testing |
188
- | **Fraud Triage Sandbox** | Application | Rule-based fraud detection |
189
- | **IFRS Accrual Estimator** | Calculator | Actuarial reserve estimation |
190
- | **RAG Compliance Assistant** | Q&A System | Document-based compliance guidance |
191
-
192
- ## ⚠️ Important Disclaimers
193
-
194
- ### Synthetic Data Only
195
- - All datasets are **100% synthetic**
196
- - No real customer, policy, or claim data
197
- - Generated for demonstration purposes only
198
-
199
- ### Advisory Only
200
- - All outputs are **advisory and illustrative**
201
- - Not suitable for production use
202
- - Not intended for actual business decisions
203
-
204
- ### No Real Business Logic
205
- - No real insurer names or policies
206
- - No actuarial formulas from real companies
207
- - No KYC fields or sensitive data
208
- - No pricing or quoting functionality
209
-
210
- ### Professional Guidance Required
211
- - Consult qualified professionals for real implementations
212
- - Verify all information with authoritative sources
213
- - Follow regulatory requirements and standards
214
 
215
- ## 🎓 Educational Use
216
 
217
- These tools are designed for:
218
- - **Learning**: Understanding insurance AI concepts
219
- - **Training**: Teaching insurance operations
220
- - **Prototyping**: Testing workflows and ideas
221
- - **Demonstration**: Showcasing capabilities
 
222
 
223
- ## 🔒 Compliance & Safety
224
 
225
- All repositories follow these principles:
226
- - **Privacy**: No real personal data
227
- - **Security**: No sensitive information
228
- - **Transparency**: Clear disclaimers and limitations
229
- - **Ethics**: Fair and unbiased demonstrations
 
230
 
231
- ## 📖 Documentation
232
 
233
- Each repository includes:
234
- - **README.md**: Overview and usage instructions
235
- - **model_card.md**: Detailed technical documentation
236
- - **requirements.txt**: Python dependencies
237
- - **Utility files**: Supporting code and functions
238
 
239
- ## 🚀 Getting Started
240
-
241
- 1. **Browse** the repositories above
242
- 2. **Click** on the repository links to access
243
- 3. **Explore** the interactive demos
244
- 4. **Learn** from the examples and documentation
245
-
246
- ## 💡 Use Case Examples
247
-
248
- ### For Developers
249
- - Test insurance applications with synthetic data
250
- - Prototype fraud detection workflows
251
- - Learn actuarial calculation methods
252
- - Implement RAG systems for compliance
253
-
254
- ### For Business Analysts
255
- - Understand fraud triage processes
256
- - Learn IFRS 17 measurement principles
257
- - Explore compliance documentation approaches
258
- - Analyze synthetic insurance data
259
-
260
- ### For Students & Educators
261
- - Study insurance operations
262
- - Learn AI/ML applications in insurance
263
- - Practice with realistic (but synthetic) scenarios
264
- - Understand regulatory frameworks
265
-
266
- ## 🔄 Updates & Maintenance
267
-
268
- These repositories are demonstration tools and may be updated periodically with:
269
- - Bug fixes and improvements
270
- - Additional features
271
- - Enhanced documentation
272
- - New examples and use cases
273
-
274
- ## 📞 Contact & Feedback
275
 
276
- For questions, feedback, or suggestions:
277
- - Visit individual repository pages
278
- - Review documentation and model cards
279
- - Contact Vercept for more information
280
 
281
- ---
282
 
283
- ## 🏗️ Architecture Overview
284
 
285
- ```
286
- GCC Insurance AI Hub (This Page)
287
- |
288
- ├── Insurance Datasets (Synthetic)
289
- | └── Claims, Policies, Fraud Indicators
290
- |
291
- ├── Fraud Triage Sandbox
292
- | └── Rule-based Detection & Triage
293
- |
294
- ├── IFRS 17 Accrual Estimator
295
- | └── Chain Ladder & Reserve Calculation
296
- |
297
- └── RAG Compliance Assistant
298
- └── Document Retrieval & Q&A
299
- ```
300
 
301
- ## 🎯 Future Enhancements
302
 
303
- Potential additions to this hub:
304
- - Additional datasets (underwriting, claims processing)
305
- - More specialized calculators
306
- - Advanced ML models (with synthetic data)
307
- - Integration examples
308
- - API documentation
309
 
310
  ---
311
 
312
- **Built by Qoder for Vercept** | All data synthetic | Advisory only
313
-
314
- **Version**: 1.0.0 | **Last Updated**: January 2026
315
  """)
316
 
317
  if __name__ == "__main__":
 
1
  """
2
  GCC Insurance AI Hub
3
+ Central landing page linking to insurance AI demonstration spaces.
4
  """
5
 
6
  import gradio as gr
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  # Create Gradio interface
9
  with gr.Blocks(title="GCC Insurance AI Hub", theme=gr.themes.Soft()) as demo:
10
  gr.Markdown("""
11
+ # 🏢 GCC Insurance Intelligence Lab
12
 
13
+ ## ⚠️ CRITICAL DISCLAIMER
14
 
15
+ **All tools in this hub are for EDUCATIONAL and DEMONSTRATION purposes ONLY.**
16
 
17
+ - **NOT for production use** in any insurance operations
18
+ - **NOT a substitute** for qualified professionals (actuaries, compliance, legal)
19
+ - **All data is 100% synthetic** - no real policies, claims, or customer information
20
+ - **All outputs are advisory only** and require human expert validation
21
+ - **No liability** for decisions based on these tools
22
 
23
+ ### Compliance & Safety:
24
 
25
+ - **No real insurer names** or product information
26
+ - **No confidential rulebooks** or proprietary logic
27
+ - **No pricing or reserving** for actual business use
28
+ - **No KYC or personal identity** signals
29
+ - **Human-in-the-loop enforced** for all outputs
30
 
31
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
+ ## 📊 Available Spaces
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ This hub provides access to four demonstration spaces:
36
+ """)
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ # Space 1: Fraud Triage Sandbox
39
+ with gr.Row():
40
+ with gr.Column():
41
+ gr.Markdown("""
42
+ ### 🔍 Fraud Triage Sandbox
43
+
44
+ **Rule-based fraud detection system** for insurance claims triage.
45
+
46
+ - Inputs: claim type, sector, evidence %, behavior pattern, claim history
47
+ - Outputs: Low/Medium/High fraud likelihood with explanations
48
+ - Includes uncertainty scoring and human review warnings
49
+
50
+ **Use Case**: Educational demonstration of fraud detection logic
51
+
52
+ [Open Fraud Triage Sandbox](https://huggingface.co/spaces/YOUR_USERNAME/fraud-triage-sandbox)
53
+ """)
54
+
55
+ # Space 2: IFRS Claim Accrual Estimator
56
+ with gr.Row():
57
+ with gr.Column():
58
+ gr.Markdown("""
59
+ ### 💰 IFRS Claim Accrual Estimator
60
+
61
+ **Symbolic accrual bracket assignment** for insurance claims.
62
+
63
+ - Inputs: claim stage, severity bracket, investigation duration, IBNR flag
64
+ - Outputs: Accrual Band A-E (symbolic only, no monetary amounts)
65
+ - Includes mandatory "consult finance" warnings
66
+
67
+ **Use Case**: Educational demonstration of accrual estimation concepts
68
+
69
+ [Open IFRS Accrual Estimator](https://huggingface.co/spaces/YOUR_USERNAME/ifrs-claim-accrual-estimator)
70
+ """)
71
+
72
+ # Space 3: Document RAG Compliance Assistant
73
+ with gr.Row():
74
+ with gr.Column():
75
+ gr.Markdown("""
76
+ ### 📚 Document RAG Compliance Assistant
77
+
78
+ **Retrieval-Augmented Generation** for policy compliance questions.
79
+
80
+ - Loads synthetic policy clauses from text file
81
+ - Uses sentence transformers or TF-IDF for semantic search
82
+ - Returns most relevant clause with similarity score
83
+ - Includes out-of-scope guardrails and human review warnings
84
+
85
+ **Use Case**: Educational demonstration of RAG systems for compliance
86
+
87
+ [Open RAG Compliance Assistant](https://huggingface.co/spaces/YOUR_USERNAME/doc-rag-compliance-assistant)
88
+ """)
89
+
90
+ # Space 4: Insurance Datasets (Synthetic)
91
+ with gr.Row():
92
+ with gr.Column():
93
+ gr.Markdown("""
94
+ ### 📈 Insurance Datasets (Synthetic)
95
+
96
+ **Synthetic datasets** for testing and development.
97
+
98
+ - fraud_cases_synthetic.csv (250 rows)
99
+ - claims_lifecycle_ifrs_synthetic.csv (251 rows)
100
+ - policy_clauses_snippets.txt (12 clauses)
101
+ - All data is 100% fabricated for demonstration
102
+
103
+ **Use Case**: Synthetic data for testing insurance applications
104
+
105
+ [Open Insurance Datasets](https://huggingface.co/spaces/YOUR_USERNAME/insurance-datasets-synthetic)
106
+ """)
107
 
108
  gr.Markdown("""
109
  ---
110
 
111
+ ## 🛡Mandatory Disclaimers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
+ ### For All Spaces:
114
 
115
+ 1. **Educational Purpose Only**: These tools demonstrate AI concepts, not production systems
116
+ 2. **Synthetic Data**: All datasets are fabricated - no real insurance information
117
+ 3. **No Business Decisions**: Never use for actual pricing, reserving, claims, or underwriting
118
+ 4. **Human Validation Required**: All outputs must be reviewed by qualified professionals
119
+ 5. **No Regulatory Compliance**: These tools do not ensure compliance with any regulations
120
+ 6. **No Liability**: Vercept and Qoder assume no liability for use of these tools
121
 
122
+ ### Professional Guidance:
123
 
124
+ For actual insurance operations, always consult:
125
+ - **Actuaries** for reserving and pricing
126
+ - **Compliance officers** for regulatory matters
127
+ - **Legal counsel** for policy interpretation
128
+ - **Finance teams** for accounting and reporting
129
+ - **Underwriters** for risk assessment
130
 
131
+ ### Privacy & Security:
132
 
133
+ - No real customer data or PII
134
+ - No confidential business information
135
+ - No proprietary algorithms or formulas
136
+ - No connection to production systems
 
137
 
138
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
+ ## 📝 About This Hub
 
 
 
141
 
142
+ The GCC Insurance Intelligence Lab is a collection of demonstration tools built by **Qoder for Vercept**.
143
 
144
+ **Purpose**: Educational demonstrations of AI applications in insurance
145
 
146
+ **Technology**: Gradio, Python, sentence transformers, scikit-learn
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
+ **License**: MIT (for demonstration code only)
149
 
150
+ **Version**: 1.0.0 | **Last Updated**: January 2026
 
 
 
 
 
151
 
152
  ---
153
 
154
+ **⚠️ Remember**: These are demonstration tools only. Always consult qualified professionals for actual insurance operations.
 
 
155
  """)
156
 
157
  if __name__ == "__main__":