Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,14 +3,14 @@ import pickle
|
|
3 |
#from PIL import Image
|
4 |
|
5 |
def predict_sentiment(sentence):
|
6 |
-
sentimate_model = pickle.load(open("model (1).pkl", 'rb'))
|
7 |
-
import tensorflow as tf
|
8 |
-
pred_prob = sentimate_model.predict([sentence])
|
9 |
-
pred_label = tf.squeeze(tf.round(pred_prob)).numpy()
|
10 |
-
if pred_label > 0:
|
11 |
-
return 'Positive'
|
12 |
-
else:
|
13 |
-
return 'Negative'
|
14 |
|
15 |
gr.Interface(predict_sentiment, inputs=gr.inputs.Textbox(lines=1, label='Enter your Review')).launch()
|
16 |
|
|
|
3 |
#from PIL import Image
|
4 |
|
5 |
def predict_sentiment(sentence):
|
6 |
+
sentimate_model = pickle.load(open("model (1).pkl", 'rb'))
|
7 |
+
import tensorflow as tf
|
8 |
+
pred_prob = sentimate_model.predict([sentence])
|
9 |
+
pred_label = tf.squeeze(tf.round(pred_prob)).numpy()
|
10 |
+
if pred_label > 0:
|
11 |
+
return 'Positive'
|
12 |
+
else:
|
13 |
+
return 'Negative'
|
14 |
|
15 |
gr.Interface(predict_sentiment, inputs=gr.inputs.Textbox(lines=1, label='Enter your Review')).launch()
|
16 |
|