from transformers import pipeline import gradio as gr ner_pipeline = pipeline("ner", model="mrojas/spanish-disease-tagger") examples = [ "Paciente con hipertensión, diabetes mellitus II. Tiene mucho dolor de cabeza.", ] def ner(text): output = ner_pipeline(text) return {"text": text, "entities": output} demo = gr.Interface(ner, gr.Textbox(placeholder="Ingrese oración aquí..."), gr.HighlightedText(), examples=examples) demo.launch()