Commit
·
b4532a8
1
Parent(s):
a999ecb
Update README.md
Browse files
README.md
CHANGED
|
@@ -39,11 +39,11 @@ from transformers import pipeline
|
|
| 39 |
|
| 40 |
model_path = "citizenlab/distilbert-base-multilingual-cased-toxicity"
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
> [{'label': 'not_toxic', 'score': 0.9954179525375366}]
|
| 45 |
|
| 46 |
-
|
| 47 |
> [{'label': 'toxic', 'score': 0.9948776960372925}]
|
| 48 |
|
| 49 |
```
|
|
|
|
| 39 |
|
| 40 |
model_path = "citizenlab/distilbert-base-multilingual-cased-toxicity"
|
| 41 |
|
| 42 |
+
toxicity_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
|
| 43 |
+
toxicity_classifier("this is a lovely message")
|
| 44 |
> [{'label': 'not_toxic', 'score': 0.9954179525375366}]
|
| 45 |
|
| 46 |
+
toxicity_classifier("you are an idiot and you and your family should go back to your country")
|
| 47 |
> [{'label': 'toxic', 'score': 0.9948776960372925}]
|
| 48 |
|
| 49 |
```
|