manvik28 commited on
Commit
4626e33
1 Parent(s): 966d703

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -131,8 +131,13 @@ def my_inference_function(sec_txt):
131
 
132
  mean = get_mean_from_proba(proba_list)
133
 
134
- return torch.argmax(mean).item()
135
-
 
 
 
 
 
136
 
137
  gradio_interface = gradio.Interface(
138
  fn = my_inference_function,
 
131
 
132
  mean = get_mean_from_proba(proba_list)
133
 
134
+ sentiment = torch.argmax(mean).item()
135
+ if sentiment == 0:
136
+ return 'Positive'
137
+ elif sentiment == 1:
138
+ return 'Negative'
139
+ else:
140
+ return 'Neutral'
141
 
142
  gradio_interface = gradio.Interface(
143
  fn = my_inference_function,