IvaElen commited on
Commit
d4f792b
·
1 Parent(s): ad0078c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -29,7 +29,7 @@ def predict_sentiment(model, input_tokens):
29
  output = model(**input_tokens).pooler_output.detach().numpy()
30
  with open('LogReg_imdb_Ernie.pkl', 'rb') as file:
31
  cls = pickle.load(file)
32
- result = id2label[cls.predict(output).tolist()]
33
  return result
34
 
35
  st.title('Text sentiment analysis by ErnieModel')
 
29
  output = model(**input_tokens).pooler_output.detach().numpy()
30
  with open('LogReg_imdb_Ernie.pkl', 'rb') as file:
31
  cls = pickle.load(file)
32
+ result = id2label[int(cls.predict(output))]
33
  return result
34
 
35
  st.title('Text sentiment analysis by ErnieModel')