archich's picture
Update README.md
e14e1df verified

A newer version of the Gradio SDK is available: 6.3.0

Upgrade
metadata
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:

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):

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));