Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pandas as pd | |
| from inference import predict_icd | |
| st.title("ICD-10 Classification Demo") | |
| st.write( | |
| """ | |
| Enter clinical text and the model will predict the **top 3 ICD codes**. | |
| """ | |
| ) | |
| sample_text = "Patient with type 2 diabetes mellitus" | |
| text = st.text_area( | |
| "Clinical Note", | |
| value=sample_text, | |
| height=150 | |
| ) | |
| if st.button("Predict"): | |
| results = predict_icd(text) | |
| df = pd.DataFrame( | |
| results, | |
| columns=["ICD Code","Description","Confidence"] | |
| ) | |
| df["Confidence"] = df["Confidence"].apply(lambda x: f"{x:.2%}") | |
| df.index = df.index + 1 | |
| st.table(df) |