Spaces:
Sleeping
Sleeping
import gradio as gr | |
# List of correct and incorrect drugs | |
# Corresponding to T45.2X1 | |
correct_drugs = [ | |
"Glucotrol", | |
"Glucophage", | |
"Avandia", | |
"Afrezza", | |
"Fiasp", | |
"Apidra", | |
"Admelog", | |
"Lyumjev", | |
"Tresiba", | |
"Levemir", | |
"Lantus", | |
"Semglee-yfgn", | |
"Glyset", | |
"Kazano", | |
"Invokamet", | |
"Xigduo XR", | |
"Synjardy", | |
"Segluromet", | |
"Glucovance", | |
"Jentadueto XR", | |
"Actoplus Met", | |
"PrandiMet", | |
"Avandamet", | |
"Kombiglyze XR", | |
"Janumet" | |
] | |
# Function to check if the selected drug is correct or incorrect | |
def check_drug(drug_list1,drug_list2,drug_list3,drug_list4,drug_list5): | |
drug_list = [drug_list1,drug_list2,drug_list3,drug_list4,drug_list5] | |
correct = [] | |
incorrect = [] | |
for drug in drug_list: | |
if drug not in correct_drugs: | |
incorrect.append(drug) | |
if len(incorrect) > 0: | |
return f"there is incorrect drugs {incorrect}" | |
else: | |
return f"all the drugs are correct" | |
# Gradio interface | |
iface = gr.Interface( | |
fn=check_drug, | |
inputs=["text", "text", "text", "text", "text"], | |
outputs="text", | |
) | |
# Launch the Gradio app | |
iface.launch() |