Update app.py
Browse files
app.py
CHANGED
@@ -136,40 +136,44 @@ Redacta el Auto de Medida Provisional completo siguiendo estrictamente la estruc
|
|
136 |
|
137 |
# === Interfaz Gradio (sin cambios) ===
|
138 |
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
139 |
css="""
|
140 |
body {
|
141 |
-
background-color: #
|
142 |
-
color: #ffffff;
|
143 |
-
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
144 |
}
|
145 |
-
.gr-
|
146 |
-
|
147 |
-
|
148 |
-
|
|
|
149 |
}
|
150 |
-
.gr-
|
151 |
-
|
|
|
152 |
}
|
153 |
-
.gr-
|
154 |
-
|
155 |
-
color: white !important;
|
156 |
}
|
157 |
-
.gr-textbox
|
158 |
-
color:
|
|
|
159 |
}
|
160 |
-
.gr-
|
161 |
-
|
|
|
162 |
}
|
163 |
-
"""
|
164 |
) as interfaz:
|
165 |
-
gr.Markdown(
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
gr.Markdown("<p style='color:#ffffff;'>Predice tipo de violencia, nivel de riesgo, medida cautelar y genera una decisión motivada conforme a la Ley 575 de 2000.</p>")
|
173 |
|
174 |
with gr.Row():
|
175 |
with gr.Column():
|
@@ -186,12 +190,25 @@ with gr.Blocks(
|
|
186 |
tipo_violencia_out = gr.Textbox(label="🛑 Tipo de Violencia Detectada", interactive=False)
|
187 |
riesgo_out = gr.Textbox(label="⚠️ Nivel de Riesgo Estimado", interactive=False)
|
188 |
medida_out = gr.Textbox(label="🧾 Tipo de Medida Cautelar Sugerida", interactive=False)
|
189 |
-
recomendacion_out = gr.Textbox(label="📋 Recomendación Legal Razonada", lines=
|
190 |
|
191 |
boton.click(
|
192 |
fn=predecir_con_recomendacion,
|
193 |
-
inputs=[
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
)
|
196 |
|
197 |
interfaz.launch()
|
|
|
136 |
|
137 |
# === Interfaz Gradio (sin cambios) ===
|
138 |
with gr.Blocks(
|
139 |
+
theme=gr.themes.Base(
|
140 |
+
primary_hue="green",
|
141 |
+
neutral_hue="slate",
|
142 |
+
font=[gr.themes.GoogleFont("Roboto")],
|
143 |
+
),
|
144 |
css="""
|
145 |
body {
|
146 |
+
background-color: #0b3d28;
|
|
|
|
|
147 |
}
|
148 |
+
.gr-block.gr-markdown h1 {
|
149 |
+
display: flex;
|
150 |
+
align-items: center;
|
151 |
+
gap: 16px;
|
152 |
+
color: #ffffff;
|
153 |
}
|
154 |
+
.gr-block.gr-markdown h1 img {
|
155 |
+
height: 60px;
|
156 |
+
border-radius: 4px;
|
157 |
}
|
158 |
+
.gr-block.gr-markdown p {
|
159 |
+
color: #d6f5e3;
|
|
|
160 |
}
|
161 |
+
.gr-input, .gr-textbox, .gr-button {
|
162 |
+
background-color: #ffffff !important;
|
163 |
+
color: #000000 !important;
|
164 |
}
|
165 |
+
.gr-box {
|
166 |
+
border: 1px solid #a3d9a5;
|
167 |
+
border-radius: 8px;
|
168 |
}
|
169 |
+
""",
|
170 |
) as interfaz:
|
171 |
+
gr.Markdown(
|
172 |
+
"""
|
173 |
+
<h1><img src="https://i.imgur.com/6m2M1to.png" alt="Logo Externado">LEGALFAMI – Asistente Legal con Razonamiento Jurídico</h1>
|
174 |
+
<p>Predice tipo de violencia, nivel de riesgo, medida cautelar y genera una decisión motivada conforme a la Ley 575 de 2000.</p>
|
175 |
+
"""
|
176 |
+
)
|
|
|
|
|
177 |
|
178 |
with gr.Row():
|
179 |
with gr.Column():
|
|
|
190 |
tipo_violencia_out = gr.Textbox(label="🛑 Tipo de Violencia Detectada", interactive=False)
|
191 |
riesgo_out = gr.Textbox(label="⚠️ Nivel de Riesgo Estimado", interactive=False)
|
192 |
medida_out = gr.Textbox(label="🧾 Tipo de Medida Cautelar Sugerida", interactive=False)
|
193 |
+
recomendacion_out = gr.Textbox(label="📋 Recomendación Legal Razonada", lines=16, interactive=False)
|
194 |
|
195 |
boton.click(
|
196 |
fn=predecir_con_recomendacion,
|
197 |
+
inputs=[
|
198 |
+
edad,
|
199 |
+
genero,
|
200 |
+
hijos,
|
201 |
+
convivencia_agresor,
|
202 |
+
consumo_sustancias,
|
203 |
+
apoyo_familiar,
|
204 |
+
descripcion,
|
205 |
+
],
|
206 |
+
outputs=[
|
207 |
+
tipo_violencia_out,
|
208 |
+
riesgo_out,
|
209 |
+
medida_out,
|
210 |
+
recomendacion_out,
|
211 |
+
],
|
212 |
)
|
213 |
|
214 |
interfaz.launch()
|