Update app.py
Browse files
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)
|
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')
|