Update README.md
Browse files
README.md
CHANGED
|
@@ -30,7 +30,7 @@ with torch.no_grad():
|
|
| 30 |
|
| 31 |
# Get predictions
|
| 32 |
threshold = 0.5
|
| 33 |
-
probs = torch.sigmoid(outputs.logits)
|
| 34 |
predictions = [model.config.id2label[i] for i, prob in enumerate(probs) if prob > threshold]
|
| 35 |
print(predictions)
|
| 36 |
# -> ['ppr_pos', 'wtp_neg'] (patient-provider/staff relationships:positive, waiting time for appointment:negative)
|
|
|
|
| 30 |
|
| 31 |
# Get predictions
|
| 32 |
threshold = 0.5
|
| 33 |
+
probs = torch.sigmoid(outputs.logits).squeeze()
|
| 34 |
predictions = [model.config.id2label[i] for i, prob in enumerate(probs) if prob > threshold]
|
| 35 |
print(predictions)
|
| 36 |
# -> ['ppr_pos', 'wtp_neg'] (patient-provider/staff relationships:positive, waiting time for appointment:negative)
|