File size: 804 Bytes
890615c
b7c4b7e
890615c
 
b7c4b7e
890615c
b7c4b7e
e14e1df
b7c4b7e
 
e14e1df
b7c4b7e
 
890615c
 
 
 
 
 
e14e1df
890615c
 
 
 
 
 
62be2ce
 
e14e1df
62be2ce
e14e1df
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

---
title: Hate Speech Detector API
emoji: 🛡️
colorFrom: red
colorTo: blue
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
---

# Hate Speech Detector API

This Space hosts the `archich/hate-speech-detector` model as an API.

## Using the API

### Python with Gradio Client:
```python
from gradio_client import Client

client = Client("YOUR_USERNAME/hate-speech-api")
result = client.predict("Your text here", api_name="/predict")
print(result)
```

### JavaScript (Chrome Extension):
```javascript
fetch("https://YOUR_USERNAME-hate-speech-api.hf.space/api/predict", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ data: ["Your text here"] })
})
.then(response => response.json())
.then(result => console.log(result));
```