File size: 647 Bytes
e2f1233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
from transformers import pipeline


map = {'LABEL_0':'Depression', 'LABEL_1':'Pain', 'LABEL_2':'Anxiety', 'LABEL_3':'Acne', 'LABEL_4':'Birth Control'}

def main():
    st.title("Text Classification App")
    review = st.text_area('Enter the review')

    if st.button:
        if review:
            pipe = pipeline("text-classification", model='ErnestBeckham/gpt-patientconditionclassification', tokenizer='ErnestBeckham/gpt-patientconditionclassification')
            label = pipe(review)
            st.subheader("Patient's Condition:")
            st.write(map[label[0]['label']])

if __name__ == "__main__":
    main()