Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,19 +30,19 @@ def predict_sentiment(text):
|
|
30 |
input = vectoriser.transform(input)
|
31 |
res = model.predict(input)
|
32 |
if (res==1):
|
33 |
-
sentiment="
|
34 |
else :
|
35 |
-
sentiment="
|
36 |
return sentiment
|
37 |
|
38 |
|
39 |
iface = gr.Interface(
|
40 |
fn=predict_sentiment,
|
41 |
inputs=gr.Textbox(),
|
42 |
-
outputs=gr.
|
43 |
allow_flagging="never",
|
44 |
-
title="
|
45 |
-
description="Input text
|
46 |
)
|
47 |
|
48 |
|
|
|
30 |
input = vectoriser.transform(input)
|
31 |
res = model.predict(input)
|
32 |
if (res==1):
|
33 |
+
sentiment="https://files.selecthealth.cloud/api/public/content/228422-being_positive_blog_lg.jpg"
|
34 |
else :
|
35 |
+
sentiment="https://mentalhealthatease.com/wp-content/uploads/2022/02/girl-with-negative-thoughts-scaled.jpeg"
|
36 |
return sentiment
|
37 |
|
38 |
|
39 |
iface = gr.Interface(
|
40 |
fn=predict_sentiment,
|
41 |
inputs=gr.Textbox(),
|
42 |
+
outputs=gr.Image(type = 'pil'),
|
43 |
allow_flagging="never",
|
44 |
+
title="Tweet Sentiment Predict",
|
45 |
+
description="Input your tweet text to predict the sentiment"
|
46 |
)
|
47 |
|
48 |
|