PatrickML commited on
Commit
05504f7
1 Parent(s): 597a991

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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="Positive"
34
  else :
35
- sentiment="Negative"
36
  return sentiment
37
 
38
 
39
  iface = gr.Interface(
40
  fn=predict_sentiment,
41
  inputs=gr.Textbox(),
42
- outputs=gr.Textbox(),
43
  allow_flagging="never",
44
- title="Twi_sentiment",
45
- description="Input text and predict the sentiment"
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