Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,11 @@ import gradio as gr
|
|
2 |
from sentiment import vectr, clf
|
3 |
|
4 |
def predict(text):
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
return text_sent
|
7 |
|
8 |
demo = gr.Interface(fn=predict, inputs="text", outputs="text")
|
|
|
2 |
from sentiment import vectr, clf
|
3 |
|
4 |
def predict(text):
|
5 |
+
senti = clf.predict(vectr.transform([text]))
|
6 |
+
if (int(senti)):
|
7 |
+
text_sent = "Positive Sentiment detected"
|
8 |
+
else:
|
9 |
+
text_sent = "Negative Sentiment detected"
|
10 |
return text_sent
|
11 |
|
12 |
demo = gr.Interface(fn=predict, inputs="text", outputs="text")
|