Text Profanity Detection

The Text Profanity Detection model will help you detect and replace the profane words in a given conversation or text.

API Request

Returns the predicted emotion for a given sentence

POST https://api.marsview.ai/text/profanity/get_profanity

Query Parameters

NameTypeDescription

jwtToken*

String

Marsview api access token. You can generate it here: https://docs.marsview.ai/speech-analytics-api/authentication

text*

String

The sentence you want to detect emotion

userId*

String

Your Marsview user ID

replaceChar*

String

The string character you want to replace detected profane words with

{
    "status": true,
    "error": {},
    "data": {
        "censoredText": "This is some random ******** text",
        "customProfaneWords": [
            "bullshit"
        ],
        "predefinedProfaneWords": []
    },
    "userId": "chandra.sekhar@marsview.ai"
}

Example Curl Request

Shown below is a code snippet to send a sample request for profanity detection

curl --location --request POST 'https://api.marsview.ai/text/profanity/get_profanity' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jwtToken"   : "Insert JWT token Key",
    "sentence"   : "Insert your text for profanity detection here",
    "replaceChar": "The character you want to replace profane words with"
    "userId"     : "demo@marsview.ai"
}'

Example Response

Shown below is a sample JSON response from the above request.

{
    "status": true,
    "error": {},
    "data": {
        "censoredText": "This is some random ******** text",
        "customProfaneWords": [
            "bullshit"
        ],
        "predefinedProfaneWords": []
    },
    "userId": "chandra.sekhar@marsview.ai"
}

Response Object

FieldDescription

censoredText

The sentence / phrase for after censoring the profane words

customProfaneWords

List of custom profane words detected

predefinedProfaneWords

List of predefined profane words

Last updated