Params
The character to replace profanity with.
Response
Indicates whether the call was successful.
Usage information for the API call.
Number of input tokens processed.
Number of output tokens generated.
Number of tokens processed during inference time.
Total number of tokens used (input + output).
The message returned by the API.
The text with profanity replaced by the censor_replacement character.
An array of profanities found in the text.
The profane word that was detected.
The starting position of the profanity in the original text.
The ending position of the profanity in the original text.
Returns True if profanity is found in the sentence
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.validate.profanity({
"text": "This is a sample text that might contain inappropriate language."
})
{
"success": true,
"profanities_found": false,
"profanities": [],
"clean_text": "This is a sample text that might contain inappropriate language.",
"_usage": {
"input_tokens": 20,
"output_tokens": 35,
"inference_time_tokens": 114,
"total_tokens": 169
}
}