thak123 commited on
Commit
11504f2
·
1 Parent(s): c0f15ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -15,9 +15,6 @@ MODEL = None
15
  DEVICE = config.device
16
  T = tokenizer.TweetTokenizer(preserve_handles=True, preserve_hashes=True, preserve_case=False, preserve_url=False)
17
 
18
- def get_sentiment(input_text):
19
- result = sentiment(input_text)
20
- return f"result: {result[0]['label']}", f"score: {result[0]['score']}"
21
 
22
  def preprocess(text):
23
  tokens = T.tokenize(text)
@@ -69,7 +66,7 @@ def sentence_prediction(sentence):
69
  interface = gr.Interface(
70
  fn=sentence_prediction,
71
  inputs='text',
72
- outputs=['text', 'text'],
73
  title='Sentiment Analysis',
74
  description='Get the positive/negative sentiment for the given input.'
75
  )
 
15
  DEVICE = config.device
16
  T = tokenizer.TweetTokenizer(preserve_handles=True, preserve_hashes=True, preserve_case=False, preserve_url=False)
17
 
 
 
 
18
 
19
  def preprocess(text):
20
  tokens = T.tokenize(text)
 
66
  interface = gr.Interface(
67
  fn=sentence_prediction,
68
  inputs='text',
69
+ outputs=['text'],
70
  title='Sentiment Analysis',
71
  description='Get the positive/negative sentiment for the given input.'
72
  )