dkhd / non-toxic

A toxic comment detection API

Home Page:https://toxicity.space

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toxicity Space, A Toxic Comment Detection API

The comment section has been an interesting part of many applications or websites since long ago. It enables the users to express their ideas freely. However, without moderation, the comment section will become unhealthy and will turn out to be a war place.

But what if we don't have a human moderator?

Toxicity Space provides you an API that you can use to detect toxic comment in your application.

Using The API in Your App

If you are using Javascript for your application, you can use this code snippet to send the request to the API:

const requestOptions = {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ text: "hey, nice shirt you are wearing today" }),
    };

fetch('https://toxicity.space/api', requestOptions)
      .then((response) => response.json())
      .then((data) => {
        console.log(data)
      });

But if you want to use curl you can use this:

curl -X POST https://toxicity.space/api
   -H 'Content-Type: application/json'
   -d '{"text":"hey, nice shirt you are wearing today"}'

Detailed information about this project can be read here.


This project is built with ♥️ by Diky Hadna to participate in the Linode x Hashnode 2022 Hackathon.

Licensed under MIT License.

Supported by Linode & Hashnode

About

A toxic comment detection API

https://toxicity.space

License:MIT License


Languages

Language:JavaScript 93.1%Language:HTML 3.2%Language:CSS 2.4%Language:Pug 1.2%Language:Shell 0.1%