anoopreddyyeddula commited on
Commit
455f086
·
1 Parent(s): 54c68aa

fix: resolve merge conflicts and update UI

Browse files
Files changed (1) hide show
  1. app.py +106 -14
app.py CHANGED
@@ -70,20 +70,112 @@ def process_document(file):
70
  logger.error(f"Error processing insurance claim: {str(e)}")
71
  return f"Error processing claim: {str(e)}", None, None
72
 
73
- # Create Gradio interface
74
- iface = gr.Interface(
75
- fn=process_document,
76
- inputs=gr.File(label="Upload Insurance Claim Document"),
77
- outputs=[
78
- gr.Textbox(label="Extracted Claim Details"),
79
- gr.Textbox(label="Claim Validation Results"),
80
- gr.Textbox(label="Document Classification")
81
- ],
82
- title="Automated Insurance Claim Validation System",
83
- description="Upload insurance claim documents (PDF or image) for automated validation and analysis",
84
- theme="default",
85
- css=".gradio-container {max-width: 800px; margin: auto}"
86
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  if __name__ == "__main__":
89
  iface.launch(server_name="0.0.0.0", server_port=7860)
 
70
  logger.error(f"Error processing insurance claim: {str(e)}")
71
  return f"Error processing claim: {str(e)}", None, None
72
 
73
+ # Custom CSS for better UI
74
+ custom_css = """
75
+ .gradio-container {
76
+ max-width: 900px !important;
77
+ margin: auto;
78
+ padding-top: 1.5rem;
79
+ padding-bottom: 1.5rem;
80
+ }
81
+
82
+ .main-div {
83
+ display: flex;
84
+ flex-direction: column;
85
+ gap: 20px;
86
+ }
87
+
88
+ .container {
89
+ border-radius: 10px;
90
+ background-color: #ffffff;
91
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
92
+ margin-bottom: 20px;
93
+ padding: 20px;
94
+ }
95
+
96
+ .output-div {
97
+ min-height: 100px;
98
+ margin-bottom: 10px;
99
+ }
100
+
101
+ h1 {
102
+ color: #2a4365;
103
+ text-align: center;
104
+ font-size: 2.5rem;
105
+ margin-bottom: 1rem;
106
+ font-weight: bold;
107
+ }
108
+
109
+ .description {
110
+ text-align: center;
111
+ color: #4a5568;
112
+ margin-bottom: 2rem;
113
+ }
114
+
115
+ .file-upload {
116
+ border: 2px dashed #cbd5e0;
117
+ border-radius: 8px;
118
+ padding: 20px;
119
+ text-align: center;
120
+ transition: all 0.3s ease;
121
+ }
122
+
123
+ .file-upload:hover {
124
+ border-color: #4299e1;
125
+ }
126
+
127
+ .output-label {
128
+ font-weight: bold;
129
+ color: #2d3748;
130
+ margin-bottom: 0.5rem;
131
+ }
132
+
133
+ .output-text {
134
+ background-color: #f7fafc;
135
+ border-radius: 6px;
136
+ padding: 12px;
137
+ }
138
+ """
139
+
140
+ # Create Gradio interface with enhanced UI
141
+ with gr.Blocks(css=custom_css) as iface:
142
+ gr.HTML("<h1>🔍 Automated Insurance Claim Validation System</h1>")
143
+ gr.HTML("""
144
+ <div class="description">
145
+ Upload insurance claim documents (PDF or image) for automated validation and analysis.
146
+ Our AI system will process and validate your claims instantly.
147
+ </div>
148
+ """)
149
+
150
+ with gr.Row():
151
+ with gr.Column():
152
+ file_input = gr.File(
153
+ label="Upload Insurance Claim Document",
154
+ file_types=["pdf", "png", "jpg", "jpeg"],
155
+ elem_classes="file-upload"
156
+ )
157
+
158
+ with gr.Row():
159
+ with gr.Column():
160
+ text_output = gr.Textbox(
161
+ label="Extracted Claim Details",
162
+ elem_classes="output-div",
163
+ lines=5
164
+ )
165
+ validation_output = gr.Textbox(
166
+ label="Claim Validation Results",
167
+ elem_classes="output-div"
168
+ )
169
+ classification_output = gr.Textbox(
170
+ label="Document Classification",
171
+ elem_classes="output-div"
172
+ )
173
+
174
+ file_input.change(
175
+ fn=process_document,
176
+ inputs=[file_input],
177
+ outputs=[text_output, validation_output, classification_output]
178
+ )
179
 
180
  if __name__ == "__main__":
181
  iface.launch(server_name="0.0.0.0", server_port=7860)