Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Cargar modelo desde Hugging Face | |
classifier = pipeline("text-classification", model="prabinpanta0/Patient-Readmission-Prediction") | |
# Funci贸n de predicci贸n | |
def predict_readmission(text): | |
result = classifier(text) | |
return f"Probabilidad de readmisi贸n: {result[0]['label']} (Score: {round(result[0]['score'], 2)})" | |
# Interfaz con Gradio | |
interface = gr.Interface( | |
fn=predict_readmission, | |
inputs=gr.Textbox(lines=4, placeholder="Ingresa la informaci贸n del paciente..."), | |
outputs="text", | |
title="Predicci贸n de Reingreso de Pacientes", | |
description="Este modelo predice si un paciente ser谩 readmitido al hospital seg煤n su historial." | |
) | |
interface.launch() | |