srini047 commited on
Commit
0f9423b
1 Parent(s): 3328b56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -2,7 +2,11 @@ import gradio as gr
2
  from sentiment import vectr, clf
3
 
4
  def predict(text):
5
- text_sent = clf.predict(vectr.transform([text]))
 
 
 
 
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")