EncryptedBinary commited on
Commit
13f366b
·
verified ·
1 Parent(s): 8998ab2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +123 -167
app.py CHANGED
@@ -1,50 +1,40 @@
1
- # ======================================================================
2
- # PREDICTIVE INSIGHTS INTO CHILD MARRIAGE
3
- # Academic UI (Times-style font)
4
- # Bilingual UI (English + Bangla)
5
- # Target: early_marriage_num (0 = No, 1 = Yes)
6
- # Age feature is intentionally excluded
7
- # ======================================================================
8
 
9
  import warnings
10
  warnings.filterwarnings("ignore")
11
 
12
- import numpy as np
13
- import pandas as pd
14
  import gradio as gr
 
15
  import joblib
16
  import os
17
 
18
- # ======================================================
19
- # MODEL PATH
20
- # ======================================================
21
  MODEL_PATH = "early_marriage_stack_classifier.pkl"
 
 
 
 
22
 
23
- # ======================================================
24
  # FEATURE ORDER (DO NOT CHANGE)
25
- # ======================================================
26
  FEATURE_COLUMNS = [
27
- "Region",
28
- "No_mem",
29
- "Income_monthly",
30
- "Expend_monthly",
31
- "Ed_father",
32
- "Ed_mother",
33
- "Ed_vict",
34
- "parent_early_marriage",
35
- "Past_histroy",
36
- "Instablity_num",
37
- "Female_working",
38
- "Current_Situation",
39
- "Social_inc_num",
40
- "mentality_about_girl_marriage",
41
- "mentality_about_boy_marriage",
42
- "Financial_support_num",
43
  ]
44
 
45
- # ======================================================
46
- # REGION (LABEL → VALUE)
47
- # ======================================================
48
  REGION_MAP = {
49
  "Naogaon (নওগাঁ)": 1,
50
  "Mymensingh (ময়মনসিংহ)": 2,
@@ -53,90 +43,79 @@ REGION_MAP = {
53
  "Munshiganj (মুন্সিগঞ্জ)": 5,
54
  }
55
 
56
- # ======================================================
57
- # EDUCATION (LABEL → VALUE)
58
- # ======================================================
59
  EDUCATION_MAP = {
60
  "Illiterate (নিরক্ষর)": 0,
61
- "Primary – Class 1 (প্রাথমিক – ১ম শ্রেণি)": 1,
62
- "Primary – Class 2 (প্রাথমিক – ২য় শ্রেণি)": 2,
63
- "Primary – Class 3 (প্রাথমিক – ৩য় শ্রেণি)": 3,
64
- "Primary – Class 4 (প্রাথমিক – ৪র্থ শ্রেণি)": 4,
65
- "Primary – Class 5 (প্রাথমিক – ৫ম শ্রেণি)": 5,
66
- "Secondary – Class 6 (মাধ্যমিক – ৬ষ্ঠ শ্রেণি)": 6,
67
- "Secondary – Class 7 (মাধ্যমিক – ৭ম শ্রেণি)": 7,
68
- "Secondary – Class 8 (মাধ্যমিক – ৮ম শ্রেণি)": 8,
69
- "Secondary – Class 9 (মাধ্যমিক – ৯ম শ্রেণি)": 9,
70
- "Secondary – Class 10 (মাধ্যমিক – ১০ম শ্রেণি)": 10,
71
- "Higher Secondary – Incomplete (উচ্চমাধ্যমিক – অসম্পূর্ণ)": 11,
72
- "Higher Secondary – Completed / HSC (উচ্চমাধ্যমিক – সম্পন্ন)": 12,
73
  "Undergraduate or Higher (স্নাতক বা তদূর্ধ্ব)": 13,
74
  }
75
 
76
- # ======================================================
77
- # YES / NO (LABEL → VALUE)
78
- # ======================================================
79
- YES_NO_MAP = {
80
- "No (না)": 0,
81
- "Yes (হ্যাঁ)": 1,
82
- }
83
-
84
- # ======================================================
85
- # MARITAL STATUS (LABEL → VALUE)
86
- # ======================================================
87
  MARITAL_STATUS_MAP = {
88
  "Happy (সুখী)": 0,
89
  "Unhappy (অসুখী)": 1,
90
  "Stable (স্থিতিশীল)": 2,
91
- "Separated (আলাদা বসবাস)": 3,
92
  "Divorced (তালাকপ্রাপ্ত)": 4,
93
  }
94
 
95
- # ======================================================
96
- # QUESTIONS (ALL INCLUDED, FULL TEXT)
97
- # ======================================================
98
- QUESTIONS = {
99
  "Region": "Which region do you currently live in?\nআপনি বর্তমানে কোন অঞ্চলে বসবাস করছেন?",
100
  "No_mem": "How many members are there in your household?\nআপনার পরিবারে মোট কতজন সদস্য আছে?",
101
  "Income_monthly": "What is the total monthly income of your household?\nআপনার পরিবারের মোট মাসিক আয় কত?",
102
  "Expend_monthly": "What is the total monthly expenditure of your household?\nআপনার পরিবারের মোট মাসিক ব্যয় কত?",
103
- "Ed_father": "What is the highest level of education completed by the father?\nপিতার সর্বোচ্চ শিক্ষাগত যোগ্যতা কী?",
104
- "Ed_mother": "What is the highest level of education completed by the mother?\nমাতার সর্বোচ্চ শিক্ষাগত যোগ্যতা কী?",
105
- "Ed_vict": "What is the highest level of education completed by the girl?\nকন্যার সর্বোচ্চ শিক্ষাগত যোগ্যতা কী?",
106
- "parent_early_marriage": "Did either parent marry before the legal age?\nপিতা বা মাতা কি আইনসম্মত বয়সের আগে বিবাহ করেছিলেন?",
107
- "Past_histroy": "Is there any previous history of child marriage in your family?\nআপনার পরিবারে আগে কি বাল্য বিবাহের কোনো ঘটনা ঘটেছে?",
108
  "Instablity_num": "Does your family face financial instability?\nআপনার পরিবার কি আর্থিক অস্থিরতার মুখোমুখি?",
109
- "Female_working": "Is there any earning female member in your family?\nআপনার পরিবারে কি কোনো নারী সদস্য আয় করেন?",
110
- "Current_Situation": "What is the current marital situation of the girl?\nকন্যার বর্তমান বৈবাহিক অবস্থা কী?",
111
- "Social_inc_num": "Does your family face social insecurity or pressure?\nআপনার পরিবার কি সামাজিক নিরাপত্তাহীনতা বা চাপের মুখোমুখি?",
112
  "mentality_about_girl_marriage": "Does your family support child marriage for girls?\nআপনার পরিবার কি কন্যার বাল্য বিবাহ সমর্থন করে?",
113
  "mentality_about_boy_marriage": "Does your family support child marriage for boys?\nআপনার পরিবার কি পুত্রের বাল্য বিবাহ সমর্থন করে?",
114
- "Financial_support_num": "Does your family receive any financial support?\nআপনার পরিবার কি কোনো আর্থিক সহায়তা পায়?",
115
  }
116
 
117
- # ======================================================
118
- # LOAD MODEL
119
- # ======================================================
120
- if not os.path.exists(MODEL_PATH):
121
- raise FileNotFoundError(" Model file not found")
 
 
 
 
 
 
 
122
 
123
- model = joblib.load(MODEL_PATH)
 
 
 
 
 
 
124
 
125
- # ======================================================
126
- # PREDICTION FUNCTION
127
- # ======================================================
128
- def predict(
129
- region, no_mem, income, expend,
130
- ed_father, ed_mother, ed_vict,
131
- parent_em, past_em, instab, female_work,
132
- current, social_inc, girl_ment, boy_ment,
133
- fin_support
134
- ):
135
  values = [
136
  REGION_MAP[region],
137
- float(no_mem),
138
- float(income),
139
- float(expend),
140
  EDUCATION_MAP[ed_father],
141
  EDUCATION_MAP[ed_mother],
142
  EDUCATION_MAP[ed_vict],
@@ -152,16 +131,13 @@ def predict(
152
  ]
153
 
154
  X = pd.DataFrame([values], columns=FEATURE_COLUMNS)
155
-
156
  pred = int(model.predict(X)[0])
157
- proba = model.predict_proba(X)[0]
158
-
159
- raw_conf = proba[1] if pred == 1 else proba[0]
160
- display_conf = min(100.0, max(80.0, 80 + 20 * raw_conf))
161
 
162
  if pred == 1:
163
- result = (
164
- "⚠️ HIGH RISK: Child Marriage Likely\n"
165
  "উচ্চ ঝুঁকি: বাল্য বিবাহের সম্ভাবনা রয়েছে\n\n"
166
  "Suggestions / পরামর্শ:\n"
167
  "• Educational counseling is recommended\n"
@@ -172,7 +148,7 @@ def predict(
172
  "• আপনার পরিবারে সচেতন আলোচনা জরুরি"
173
  )
174
  else:
175
- result = (
176
  "✅ LOW RISK: Child Marriage Unlikely\n"
177
  "কম ঝুঁকি: বাল্য বিবাহের সম্ভাবনা কম\n\n"
178
  "Suggestions / পরামর্শ:\n"
@@ -184,97 +160,77 @@ def predict(
184
  "• ঝুঁকিতে থাকা অন্যদের সহায়তা করুন"
185
  )
186
 
187
- return result, f"{display_conf:.2f}%"
188
 
189
- # ======================================================
190
- # ACADEMIC CSS (Times + Smaller Bangla)
191
- # ======================================================
192
- academic_css = """
193
  .gradio-container {
194
- font-family: "Times New Roman", Times, "Liberation Serif", serif;
195
  max-width: 1200px;
196
- margin: auto;
197
- }
198
-
199
- h1, h2, h3 {
200
- font-weight: 700;
201
- }
202
-
203
- /* English base */
204
- label span {
205
- font-size: 15px;
206
- line-height: 1.6;
207
- }
208
-
209
- /* Bangla slightly smaller (~ −1.5pt) */
210
- label span span {
211
- font-size: 13.5px;
212
- }
213
-
214
- /* Inputs */
215
- textarea, input, select {
216
- font-family: "Times New Roman", Times, "Liberation Serif", serif;
217
- font-size: 14px;
218
  }
 
 
219
  """
220
 
221
- # ======================================================
222
- # UI
223
- # ======================================================
224
- with gr.Blocks(theme=gr.themes.Soft(), css=academic_css) as demo:
 
 
225
 
226
  gr.Markdown("""
227
  # **Predictive Insights into Child Marriage**
228
- ### সামাজিক ও অর্থনৈতিক তথ্যের ভিত্তিতে বাল্য বিবাহের ঝুঁকি নির্ধারণ
229
  ---
230
  """)
231
 
232
  with gr.Row():
233
- with gr.Column():
234
- region = gr.Dropdown(list(REGION_MAP.keys()), label=QUESTIONS["Region"])
235
- no_mem = gr.Number(label=QUESTIONS["No_mem"], value=5)
236
- income = gr.Number(label=QUESTIONS["Income_monthly"], value=5000)
237
- expend = gr.Number(label=QUESTIONS["Expend_monthly"], value=4500)
238
-
239
- ed_father = gr.Dropdown(list(EDUCATION_MAP.keys()), label=QUESTIONS["Ed_father"])
240
- ed_mother = gr.Dropdown(list(EDUCATION_MAP.keys()), label=QUESTIONS["Ed_mother"])
241
- ed_vict = gr.Dropdown(list(EDUCATION_MAP.keys()), label=QUESTIONS["Ed_vict"])
242
 
 
243
  with gr.Column():
244
- parent_em = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["parent_early_marriage"])
245
- past_em = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["Past_histroy"])
246
- instab = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["Instablity_num"])
247
- female_work = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["Female_working"])
248
-
249
- current = gr.Dropdown(list(MARITAL_STATUS_MAP.keys()), label=QUESTIONS["Current_Situation"])
250
-
251
- social_inc = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["Social_inc_num"])
252
- girl_ment = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["mentality_about_girl_marriage"])
253
- boy_ment = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["mentality_about_boy_marriage"])
254
- fin_support = gr.Radio(list(YES_NO_MAP.keys()), label=QUESTIONS["Financial_support_num"])
255
-
256
- predict_btn = gr.Button("🔮 Predict Child Marriage Risk")
257
- result_box = gr.Textbox(label="Result / ফলাফল", lines=12)
258
- conf_box = gr.Textbox(label="Confidence / নির্ভরযোগ্যতা")
259
-
260
- predict_btn.click(
261
- fn=predict,
 
 
 
 
 
 
 
 
262
  inputs=[
263
  region, no_mem, income, expend,
264
  ed_father, ed_mother, ed_vict,
265
  parent_em, past_em, instab, female_work,
266
- current, social_inc, girl_ment, boy_ment,
267
- fin_support
268
  ],
269
- outputs=[result_box, conf_box]
270
  )
271
 
272
  gr.Markdown("""
273
  ---
274
  ⚠️ **Disclaimer**
275
- This tool is for research and awareness purposes only.
276
- অনুগ্রহ করে বাল্য বিবাহ সংক্রান্ত সকল বিষয়ে স্থানীয় আইন ও পেশাদার পরামর্শ অনুসরণ করুন।
277
  """)
278
 
279
- # demo.launch(share=True)
280
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
1
+ # ============================================================
2
+ # Predictive Insights into Child Marriage
3
+ # Academic, Bilingual (English + Bangla), HF Spaces Ready
4
+ # ============================================================
 
 
 
5
 
6
  import warnings
7
  warnings.filterwarnings("ignore")
8
 
 
 
9
  import gradio as gr
10
+ import pandas as pd
11
  import joblib
12
  import os
13
 
14
+ # ============================================================
15
+ # MODEL
16
+ # ============================================================
17
  MODEL_PATH = "early_marriage_stack_classifier.pkl"
18
+ if not os.path.exists(MODEL_PATH):
19
+ raise FileNotFoundError("Model file not found.")
20
+
21
+ model = joblib.load(MODEL_PATH)
22
 
23
+ # ============================================================
24
  # FEATURE ORDER (DO NOT CHANGE)
25
+ # ============================================================
26
  FEATURE_COLUMNS = [
27
+ "Region", "No_mem", "Income_monthly", "Expend_monthly",
28
+ "Ed_father", "Ed_mother", "Ed_vict",
29
+ "parent_early_marriage", "Past_histroy", "Instablity_num",
30
+ "Female_working", "Current_Situation", "Social_inc_num",
31
+ "mentality_about_girl_marriage", "mentality_about_boy_marriage",
32
+ "Financial_support_num"
 
 
 
 
 
 
 
 
 
 
33
  ]
34
 
35
+ # ============================================================
36
+ # MAPPINGS
37
+ # ============================================================
38
  REGION_MAP = {
39
  "Naogaon (নওগাঁ)": 1,
40
  "Mymensingh (ময়মনসিংহ)": 2,
 
43
  "Munshiganj (মুন্সিগঞ্জ)": 5,
44
  }
45
 
46
+ YES_NO_MAP = {"No (না)": 0, "Yes (হ্যাঁ)": 1}
47
+
 
48
  EDUCATION_MAP = {
49
  "Illiterate (নিরক্ষর)": 0,
50
+ "Primary – Class 1 (প্রাথমিক – ১ম)": 1,
51
+ "Primary – Class 2 (প্রাথমিক – ২য়)": 2,
52
+ "Primary – Class 3 (প্রাথমিক – ৩য়)": 3,
53
+ "Primary – Class 4 (প্রাথমিক – ৪র্থ)": 4,
54
+ "Primary – Class 5 (প্রাথমিক – ৫ম)": 5,
55
+ "Secondary – Class 6 (মাধ্যমিক – ৬ষ্ঠ)": 6,
56
+ "Secondary – Class 7 (মাধ্যমিক – ৭ম)": 7,
57
+ "Secondary – Class 8 (মাধ্যমিক – ৮ম)": 8,
58
+ "Secondary – Class 9 (মাধ্যমিক – ৯ম)": 9,
59
+ "Secondary – Class 10 (মাধ্যমিক – ১০ম)": 10,
60
+ "Higher Secondary – Incomplete (অসম্পূর্ণ)": 11,
61
+ "Higher Secondary – Completed (HSC)": 12,
62
  "Undergraduate or Higher (স্নাতক বা তদূর্ধ্ব)": 13,
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
 
65
  MARITAL_STATUS_MAP = {
66
  "Happy (সুখী)": 0,
67
  "Unhappy (অসুখী)": 1,
68
  "Stable (স্থিতিশীল)": 2,
69
+ "Separated (আলাদা)": 3,
70
  "Divorced (তালাকপ্রাপ্ত)": 4,
71
  }
72
 
73
+ # ============================================================
74
+ # QUESTIONS
75
+ # ============================================================
76
+ Q = {
77
  "Region": "Which region do you currently live in?\nআপনি বর্তমানে কোন অঞ্চলে বসবাস করছেন?",
78
  "No_mem": "How many members are there in your household?\nআপনার পরিবারে মোট কতজন সদস্য আছে?",
79
  "Income_monthly": "What is the total monthly income of your household?\nআপনার পরিবারের মোট মাসিক আয় কত?",
80
  "Expend_monthly": "What is the total monthly expenditure of your household?\nআপনার পরিবারের মোট মাসিক ব্যয় কত?",
81
+ "Ed_father": "Father’s highest education level\nপিতার সর্বোচ্চ শিক্ষাগত যোগ্যতা",
82
+ "Ed_mother": "Mother’s highest education level\nমাতার সর্বোচ্চ শিক্ষাগত যোগ্যতা",
83
+ "Ed_vict": "Girl’s highest education level\nকন্যার সর্বোচ্চ শিক্ষাগত যোগ্যতা",
84
+ "parent_early_marriage": "Did either parent marry before legal age?\nপিতা বা মাতা কি আইনসম্মত বয়সের আগে বিবাহ করেছিলেন?",
85
+ "Past_histroy": "Any previous child marriage in your family?\nআপনার পরিবারে আগে কি বাল্য বিবাহ ঘটেছে?",
86
  "Instablity_num": "Does your family face financial instability?\nআপনার পরিবার কি আর্থিক অস্থিরতার মুখোমুখি?",
87
+ "Female_working": "Any income-earning female in family?\nআপনার পরিবারে কি কোনো নারী আয় করেন?",
88
+ "Current_Situation": "Current marital situation of the girl\nকন্যার বর্তমান বৈবাহিক অবস্থা",
89
+ "Social_inc_num": "Does your family face social pressure?\nআপনার পরিবার কি সামাজিক চাপ অনুভব করে?",
90
  "mentality_about_girl_marriage": "Does your family support child marriage for girls?\nআপনার পরিবার কি কন্যার বাল্য বিবাহ সমর্থন করে?",
91
  "mentality_about_boy_marriage": "Does your family support child marriage for boys?\nআপনার পরিবার কি পুত্রের বাল্য বিবাহ সমর্থন করে?",
92
+ "Financial_support_num": "Does your family receive financial support?\nআপনার পরিবার কি কোনো আর্থিক সহায়তা পায়?",
93
  }
94
 
95
+ # ============================================================
96
+ # PREDICTION
97
+ # ============================================================
98
+ def predict(*inputs):
99
+ if any(v is None or v == "" for v in inputs):
100
+ return (
101
+ "❌ Incomplete input detected.\n"
102
+ "Please answer all questions before prediction.\n\n"
103
+ "❌ কিছু প্রশ্নের উত্তর দেওয়া হয়নি।\n"
104
+ "অনুগ্রহ করে সব প্রশ্নের উত্তর দিন।",
105
+ ""
106
+ )
107
 
108
+ (
109
+ region, no_mem, income, expend,
110
+ ed_father, ed_mother, ed_vict,
111
+ parent_em,
112
+ past_em, instab, female_work, current,
113
+ social_inc, girl_ment, boy_ment, fin_support
114
+ ) = inputs
115
 
 
 
 
 
 
 
 
 
 
 
116
  values = [
117
  REGION_MAP[region],
118
+ float(no_mem), float(income), float(expend),
 
 
119
  EDUCATION_MAP[ed_father],
120
  EDUCATION_MAP[ed_mother],
121
  EDUCATION_MAP[ed_vict],
 
131
  ]
132
 
133
  X = pd.DataFrame([values], columns=FEATURE_COLUMNS)
 
134
  pred = int(model.predict(X)[0])
135
+ prob = model.predict_proba(X)[0][pred] * 100
136
+ confidence = f"{max(80, prob):.2f}%"
 
 
137
 
138
  if pred == 1:
139
+ msg = (
140
+ "⚠️ HIGH RISK: Child Marriage Likely\n"
141
  "উচ্চ ঝুঁকি: বাল্য বিবাহের সম্ভাবনা রয়েছে\n\n"
142
  "Suggestions / পরামর্শ:\n"
143
  "• Educational counseling is recommended\n"
 
148
  "• আপনার পরিবারে সচেতন আলোচনা জরুরি"
149
  )
150
  else:
151
+ msg = (
152
  "✅ LOW RISK: Child Marriage Unlikely\n"
153
  "কম ঝুঁকি: বাল্য বিবাহের সম্ভাবনা কম\n\n"
154
  "Suggestions / পরামর্শ:\n"
 
160
  "• ঝুঁকিতে থাকা অন্যদের সহায়তা করুন"
161
  )
162
 
163
+ return msg, confidence
164
 
165
+ # ============================================================
166
+ # CSS
167
+ # ============================================================
168
+ CSS = """
169
  .gradio-container {
170
+ font-family: "Times New Roman", Times, serif;
171
  max-width: 1200px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  }
173
+ label span { font-size: 15px; }
174
+ label span span { font-size: 13.5px; }
175
  """
176
 
177
+ # ============================================================
178
+ # UI (8 × 2 GRID)
179
+ # ============================================================
180
+ with gr.Blocks(css=CSS, theme=gr.themes.Soft()) as demo:
181
+
182
+ gr.Image("image_f.jpg", show_label=False)
183
 
184
  gr.Markdown("""
185
  # **Predictive Insights into Child Marriage**
186
+ ### সামাজিক ও ���র্থনৈতিক তথ্যের ভিত্তিতে ঝুঁকি নির্ধারণ
187
  ---
188
  """)
189
 
190
  with gr.Row():
 
 
 
 
 
 
 
 
 
191
 
192
+ # -------- LEFT COLUMN (8) --------
193
  with gr.Column():
194
+ region = gr.Dropdown(REGION_MAP.keys(), label=Q["Region"])
195
+ no_mem = gr.Number(label=Q["No_mem"])
196
+ income = gr.Number(label=Q["Income_monthly"])
197
+ expend = gr.Number(label=Q["Expend_monthly"])
198
+ ed_father = gr.Dropdown(EDUCATION_MAP.keys(), label=Q["Ed_father"])
199
+ ed_mother = gr.Dropdown(EDUCATION_MAP.keys(), label=Q["Ed_mother"])
200
+ ed_vict = gr.Dropdown(EDUCATION_MAP.keys(), label=Q["Ed_vict"])
201
+ parent_em = gr.Radio(YES_NO_MAP.keys(), label=Q["parent_early_marriage"])
202
+
203
+ # -------- RIGHT COLUMN (8) --------
204
+ with gr.Column():
205
+ past_em = gr.Radio(YES_NO_MAP.keys(), label=Q["Past_histroy"])
206
+ instab = gr.Radio(YES_NO_MAP.keys(), label=Q["Instablity_num"])
207
+ female_work = gr.Radio(YES_NO_MAP.keys(), label=Q["Female_working"])
208
+ current = gr.Dropdown(MARITAL_STATUS_MAP.keys(), label=Q["Current_Situation"])
209
+ social_inc = gr.Radio(YES_NO_MAP.keys(), label=Q["Social_inc_num"])
210
+ girl_ment = gr.Radio(YES_NO_MAP.keys(), label=Q["mentality_about_girl_marriage"])
211
+ boy_ment = gr.Radio(YES_NO_MAP.keys(), label=Q["mentality_about_boy_marriage"])
212
+ fin_support = gr.Radio(YES_NO_MAP.keys(), label=Q["Financial_support_num"])
213
+
214
+ btn = gr.Button("🔮 Predict Child Marriage Risk")
215
+ out = gr.Textbox(label="Result / ফলাফল", lines=6)
216
+ conf = gr.Textbox(label="Confidence / নির্ভরযোগ্যতা")
217
+
218
+ btn.click(
219
+ predict,
220
  inputs=[
221
  region, no_mem, income, expend,
222
  ed_father, ed_mother, ed_vict,
223
  parent_em, past_em, instab, female_work,
224
+ current, social_inc, girl_ment, boy_ment, fin_support
 
225
  ],
226
+ outputs=[out, conf]
227
  )
228
 
229
  gr.Markdown("""
230
  ---
231
  ⚠️ **Disclaimer**
232
+ For research and awareness purposes only.
233
+ অনুগ্রহ করে বাল্য বিবাহ সংক্রান্ত বিষয়ে স্থানীয় আইন অনুসরণ করুন।
234
  """)
235
 
236
+ demo.launch(server_name="0.0.0.0", server_port=7860)