Update README.md
Browse files
README.md
CHANGED
@@ -61,8 +61,15 @@ text = "Tall people are so clumsy."
|
|
61 |
predictions = classifier(text)
|
62 |
|
63 |
# Print predictions
|
64 |
-
for pred in predictions[0]:
|
65 |
print(f"{pred['label']}: {pred['score']:.3f}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
```
|
67 |
|
68 |
---
|
|
|
61 |
predictions = classifier(text)
|
62 |
|
63 |
# Print predictions
|
64 |
+
for pred in sorted(predictions[0], key=lambda x: x['score'], reverse=True)[:5]:
|
65 |
print(f"{pred['label']}: {pred['score']:.3f}")
|
66 |
+
|
67 |
+
# Output:
|
68 |
+
# physical: 1.000
|
69 |
+
# socioeconomic: 0.002
|
70 |
+
# gender: 0.002
|
71 |
+
# racial: 0.001
|
72 |
+
# age: 0.001
|
73 |
```
|
74 |
|
75 |
---
|