- clarifai
- text-moderation
english-text-moderation-classifier
This workflow is wrapped around the English text moderation model that classifies english text as toxic, insult, obscene, identity_hate and severe_toxic.
Notes
Text moderation Classifier
This workflow is wrapped around the English text moderation model that classifies english text as toxic, insult, obscene, identity_hate and severe_toxic.
English Text Moderation Model
The english text moderation model can analyze text and detect harmful content. It is especially useful for detecting third-party content that may cause problems.
This model returns a list of concepts along with their corresponding probability scores indicating the likelihood that these concepts are present in the text. The list of concepts includes:
- toxic
- insult
- obscene
- identity_hate
- severe_toxic
- threat
English text moderation mode is fine-tuned using Kaggle's Toxic Comment Classification Challenge dataset..
How to use the English text moderation workflow?
Using Clarifai SDK
Export your PAT as an environment variable. Then, import and initialize the API Client.
Find your PAT in your security settings.
export CLARIFAI_PAT={your personal access token}
Prediction with the workflow
from clarifai.client.workflow import Workflow
workflow_url = 'https://clarifai.com/{{user_id}}/text-moderation/workflows/english-text-moderation-classifier'
text = 'I love this movie and i would watch it again and again!'
prediction = Workflow(workflow_url).predict_by_bytes(text.encode(), input_type="text")
# Get workflow results
print(prediction.results[0].outputs[-1].data)
Using Workflow
To utilize the Sentiment Analysis workflow, you can input text through the Blue Plus Try your own Input button and it will that classifies text as toxic, insult, obscene, identity_hate and severe_toxic.
- Workflow IDenglish-text-moderation-classifier
- DescriptionThis workflow is wrapped around the English text moderation model that classifies english text as toxic, insult, obscene, identity_hate and severe_toxic.
- Last UpdatedApr 09, 2024
- PrivacyPUBLIC
- Share