Skip to content

MansoorHussain12/profanity-api

Repository files navigation

Profanity Check API

This API endpoint, built with hono-js, uses a vector database from Upstash and is deployed on Cloudflare as a worker. It checks the profanity level of a given message and returns a response indicating whether the message contains profanity, along with a score representing the severity.

Features

  • Profanity Detection: Analyze messages for profanity.
  • Scoring System: Receive a score indicating the severity of the profanity.
  • Deployment: Seamless deployment as a Cloudflare Worker.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/MansoorHussain12/profanity-api.git
    
    cd profanity-api
    
  2. Install Dependecies:

   npm install
  1. Configure Upstash:

    • Set up your Upstash vector database and obtain your credentials.
    • Create Wrangler.toml file and add Upstash credentials to it.
  2. Deploy on Cloudflare:

    • npm run deploy
      

Usage

To check the profanity level of a message, send a POST request to the API endpoint with a JSON object containing the message.

Request

{
  "message": "Hello World"
}

Response If no profanity is detected:

{
  "isProfanity": false,
  "score": 0.76693106
}

About

An API endpoint where you can check the profanity in words and sentences.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published