We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
0 parents commit f899465Copy full SHA for f899465
3 files changed
.gitignore
@@ -0,0 +1,2 @@
1
+screenshot.png
2
+models
nlp.py
@@ -0,0 +1,16 @@
+import streamlit as st
+import tensorflow as tf
3
+
4
+st.markdown('## 🎡🏰🚝🎠🪧🎈✨🍬🎆🎇🎪')
5
+st.title('Disneyland Reviews Classification')
6
7
+model_1 = tf.keras.models.load_model('model_1')
8
+sentiment = {0: 'negative', 1: 'positive'}
9
10
+review = st.text_area('Enter a review of your experience at Disneyland', height=350)
11
12
+if st.button('Submit'):
13
+ pred_prob = tf.squeeze(model_1.predict([review]))
14
+ pred = tf.round(pred_prob)
15
+ st.markdown(f"The review is {tf.cast(pred_prob*100, tf.uint8)}% **{sentiment[int(pred)]}**")
16
+ #print(f"pred {int(pred)}, prob {pred_prob}")
requirements.txt
+streamlit==1.3.1
+tensorflow==2.5.0
0 commit comments