Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,14 +34,14 @@ def use(input_text):
|
|
34 |
|
35 |
# Print the prediction
|
36 |
if prediction[0]<0.5:
|
37 |
-
return "That's Negative! (" + str(round(round(1-prediction[0],2)*100,1)) + "% confidence)"
|
38 |
if prediction[0]>0.5:
|
39 |
-
return "That's Positive! (" + str(round(round(prediction[0],2)*100,1)) + "% confidence)"
|
40 |
|
41 |
|
42 |
iface = gr.Interface(fn=use,
|
43 |
inputs=gr.Textbox(lines=3, placeholder="Type Something Awesome..."),
|
44 |
-
outputs=gr.Textbox(lines=3, placeholder="Waiting For Magic..."),
|
45 |
title="Use RSA (Review Sentiment Analysis) v0.1.2",
|
46 |
description="<centre>This is an NLP model that accepts a text string as input and simply outputs if the string is mean or nice with about 96.5% accuracy. It also provides you with a score of how positive or negative it is.</centre>",
|
47 |
article="\nRSA v0.1.2: @2.29M Params w/ 96.5% acc. & 388MB dataset + 1.59MB output dataset. Trained on <a href='https://www.kaggle.com/datasets/ilhamfp31/yelp-review-dataset'>this Kaggle dataset</a>",
|
|
|
34 |
|
35 |
# Print the prediction
|
36 |
if prediction[0]<0.5:
|
37 |
+
return "That's Negative! (" + str(round(round(1-prediction[0],2)*100,1)) + "% confidence)", prediction[0]
|
38 |
if prediction[0]>0.5:
|
39 |
+
return "That's Positive! (" + str(round(round(prediction[0],2)*100,1)) + "% confidence)", prediction[0]
|
40 |
|
41 |
|
42 |
iface = gr.Interface(fn=use,
|
43 |
inputs=gr.Textbox(lines=3, placeholder="Type Something Awesome..."),
|
44 |
+
outputs=[gr.Textbox(lines=3, placeholder="Waiting For Magic..."),"number"],
|
45 |
title="Use RSA (Review Sentiment Analysis) v0.1.2",
|
46 |
description="<centre>This is an NLP model that accepts a text string as input and simply outputs if the string is mean or nice with about 96.5% accuracy. It also provides you with a score of how positive or negative it is.</centre>",
|
47 |
article="\nRSA v0.1.2: @2.29M Params w/ 96.5% acc. & 388MB dataset + 1.59MB output dataset. Trained on <a href='https://www.kaggle.com/datasets/ilhamfp31/yelp-review-dataset'>this Kaggle dataset</a>",
|