import gradio as gr from model import predict_ner iface = gr.Interface( fn = predict_ner, inputs=gr.Textbox(placeholder="Enter sentence here..."), # inputs="text", outputs= gr.HighlightedText(combine_adjacent=True, adjacent_separator=" "), title="Named Entity Recognition for Electronic Medical Record using Bidirectional Long Short Term Memory with ClinicalBERT", description="This tool identifies and highlights entities in text.
Research purposes by Rizki Mahjati Prie Husna (4611419026)", # css="span { font-weight: bold; } .problem { background-color: red } .test { background-color: blue } .treatment { background-color: green}", examples=[ ["The patient presented with symptoms of fever and cough. A chest X-ray was performed to assess the condition."], ["After diagnosis, the physician prescribed antibiotics for the treatment of the infection."], ["""Pt is a 71 y/o male with h/o dm2 , cad s/p cabg , DVT/PE on long term anti-coagulation , ulcerative colitis on Asacol presents with brbpr starting at 9am of the morning of admission . He 'd been having lower abdominal pain for approximately the past week , a symptom for which he 's been admitted in the past . His PCP had recently started ciprofloxacin for a UTI . At 9am the morning of admission he passed a large , bloody bowel movement and came to the Michael . There , his vitals were intially stable with a hct of 36.7 , though he was felt to be hypovolemic and this hemoconcentrated ; his previous hct was 39 about five months ago . He refused an NG lavage . Although an initial DRE showed only clot , he later passed a large , bloody bowel movement , and his bp nadired to the low 90's but rested there only transiently and easily rebounded to the 130's-140's with fluid ; he then went to angiography for a tagged RBC scan where they found and embolized two vessels to the sigmoid colon . His HCT had dropped from 36.7 to 30.8 despite 2U PRBC and 3 U FFP . Is called out of the FICU as has been been HD and stable HCT . Currently denies CP , SOB , abd pain or continued BRBPR ."""] ]) iface.launch()