Text Classification
Transformers
PyTorch
Safetensors
English
deberta
Trained with AutoTrain
social
offensive speech detection
moderation
Instructions to use KoalaAI/OffensiveSpeechDetector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KoalaAI/OffensiveSpeechDetector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KoalaAI/OffensiveSpeechDetector")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KoalaAI/OffensiveSpeechDetector") model = AutoModelForSequenceClassification.from_pretrained("KoalaAI/OffensiveSpeechDetector", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
2cc0397
1
Parent(s): 5cf9217
Update README.md
Browse files
README.md
CHANGED
|
@@ -64,7 +64,7 @@ Users should carefully consider the purpose, context, and impact of using this m
|
|
| 64 |
You can use cURL to access this model:
|
| 65 |
|
| 66 |
```
|
| 67 |
-
$ curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"inputs": "I love AutoTrain"}' https://api-inference.huggingface.co/models/
|
| 68 |
```
|
| 69 |
|
| 70 |
Or Python API:
|
|
@@ -72,9 +72,9 @@ Or Python API:
|
|
| 72 |
```
|
| 73 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 74 |
|
| 75 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
| 76 |
|
| 77 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 78 |
|
| 79 |
inputs = tokenizer("I love AutoTrain", return_tensors="pt")
|
| 80 |
|
|
|
|
| 64 |
You can use cURL to access this model:
|
| 65 |
|
| 66 |
```
|
| 67 |
+
$ curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"inputs": "I love AutoTrain"}' https://api-inference.huggingface.co/models/KoalaAI/OffensiveSpeechDetector
|
| 68 |
```
|
| 69 |
|
| 70 |
Or Python API:
|
|
|
|
| 72 |
```
|
| 73 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 74 |
|
| 75 |
+
model = AutoModelForSequenceClassification.from_pretrained("KoalaAI/OffensiveSpeechDetector", use_auth_token=True)
|
| 76 |
|
| 77 |
+
tokenizer = AutoTokenizer.from_pretrained("KoalaAI/OffensiveSpeechDetector", use_auth_token=True)
|
| 78 |
|
| 79 |
inputs = tokenizer("I love AutoTrain", return_tensors="pt")
|
| 80 |
|