Skip to content

Commit f899465

Browse files
author
Your Name
committed
Initial commit
0 parents  commit f899465

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
screenshot.png
2+
models

nlp.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import streamlit as st
2+
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
streamlit==1.3.1
2+
tensorflow==2.5.0

0 commit comments

Comments
 (0)