# Machine Learning Models to Detect Toxic Speech and Adult/Weapon Images and User Intent
These are local models (12MB/5MB) that detect toxic speech and more and vision models that detect adult images and images of weapons.
The models can be run on node or on the browser. SDK's are available for Python, JAVA, Node and in-the-browser that can be leverage by a chrome extension.
You can try out our API using docs at:
https://api.safekids.ai/api
### Classify Toxic Speech
```console
curl -X 'POST' \
'https://api.safekids.ai/v1/ml/classify-toxic' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"message": "you'\''re a disgusting person"
}'
```
```
RESPONSE:
{
"flag": true,
"label": "bullying_hate",
"flaggedText": "you're a disgusting person"
}
```
### Classify Google Search Intent
```console
curl -X 'POST' \
'https://api.safekids.ai/v1/ml/classify-text' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"message": "find adult sex links videos"
}'
```
```
RESPONSE:
porn
```
### Classify Adult to Gun Image (using URL)
```console
curl "https://api.safekids.ai/v1/ml/classify-image-url?url=https://cdn.britannica.com/96/176196-050-EFC5E6A6/Glock-pistol.jpg"
```
```
RESPONSE:
weapons
```
### Interact directly with our demo
[](https://demo.safekids.ai/hate)
## NLP and Vision Classification
| NLP Classification | Vision Classification |
| ------------------ |----------------|
| bullying_hate | porn |
| porn | weapons |
| proxy | clean |
| self_harm | |
| weapons | |
| clean | |
## Model Accuracy
| Label | Training Data Count | Test Data Count | f1 score | precision | recall |
|---|---|---|---|---|---|
| bullying_hate | 96,523 | 7,500 | 0.97 | 0.991 | 0.949 |
| clean | 1,351,563 | 20,000 | 0.98 | 0.99 | 0.9702 |
| porn | 300,082 | 6,500 | 0.97 | 0.993 | 0.948 |
| proxy | 8,038 | 200 | 0.94 | 0.988 | 0.896 |
| self_harm | 180,826 | 5,000 | 0.96 | 0.984 | 0.937 |
| weapons | 74,802 | 4,000 | 0.96 | 0.989 | 0.932 |
## Glossary of Terms
Precision
number of true positives / total positive predictions. - indicates the confidence of a model. i.e: if precision for class X is 0.99, 99% chance that if model predicts class X for an input, 99% chance that correct label is also X