Commit
·
e2f1233
1
Parent(s):
bf44774
app created
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
map = {'LABEL_0':'Depression', 'LABEL_1':'Pain', 'LABEL_2':'Anxiety', 'LABEL_3':'Acne', 'LABEL_4':'Birth Control'}
|
| 6 |
+
|
| 7 |
+
def main():
|
| 8 |
+
st.title("Text Classification App")
|
| 9 |
+
review = st.text_area('Enter the review')
|
| 10 |
+
|
| 11 |
+
if st.button:
|
| 12 |
+
if review:
|
| 13 |
+
pipe = pipeline("text-classification", model='ErnestBeckham/gpt-patientconditionclassification', tokenizer='ErnestBeckham/gpt-patientconditionclassification')
|
| 14 |
+
label = pipe(review)
|
| 15 |
+
st.subheader("Patient's Condition:")
|
| 16 |
+
st.write(map[label[0]['label']])
|
| 17 |
+
|
| 18 |
+
if __name__ == "__main__":
|
| 19 |
+
main()
|