Update app.py
Browse files
app.py
CHANGED
@@ -17,11 +17,11 @@ def get_output(text):
|
|
17 |
model_output = model(**model_input, return_dict=False)
|
18 |
prediction = torch.argmax(model_output[0].cpu(), dim=-1)
|
19 |
prediction = [p.item() for p in prediction]
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
|
27 |
|
|
|
17 |
model_output = model(**model_input, return_dict=False)
|
18 |
prediction = torch.argmax(model_output[0].cpu(), dim=-1)
|
19 |
prediction = [p.item() for p in prediction]
|
20 |
+
for i in range(len(prediction)):
|
21 |
+
if prediction[i]==1:
|
22 |
+
output.append("消极")
|
23 |
+
else:
|
24 |
+
output.append('积极')
|
25 |
|
26 |
|
27 |
|