Update README.md
Browse files
README.md
CHANGED
|
@@ -72,7 +72,7 @@ print(example["prediction"])
|
|
| 72 |
|
| 73 |
# Filter examples based on harm probability
|
| 74 |
def is_harmful(example, category_idx=2, threshold=0.7): # SE category (index 2)
|
| 75 |
-
return
|
| 76 |
|
| 77 |
harmful_examples = dataset.filter(is_harmful)
|
| 78 |
```
|
|
|
|
| 72 |
|
| 73 |
# Filter examples based on harm probability
|
| 74 |
def is_harmful(example, category_idx=2, threshold=0.7): # SE category (index 2)
|
| 75 |
+
return example["prediction"][category_idx][2] > threshold # Removing samples with Sexual Harm's Toxic Dimension Probability greater than 0.7
|
| 76 |
|
| 77 |
harmful_examples = dataset.filter(is_harmful)
|
| 78 |
```
|