This project is not covered by Drupal’s security advisory policy.
Microsoft provided a service to check for profanity. The purpose of this module is to make it easier to use Microsoft's content moderation service.
You will need to have an API key to use Microsoft's content moderator service. Set an environment variable called AZURE_CONTENT_MODERATION_SERVICE_KEY with your API key.
Once you set this key you can use the "azure_content_moderator.profanity_service" service to call getResults. This method will take a string argument that will be sent to Microsoft's content moderator service and return a JSON result.
The JSON result will show several categories with a number between 0 to 8. The number means how high the text scored in the given category.
For example, the following text "I hate you" would score a 2 on the hate category.
The second method to note is the isAppropriate method. This method will take the results from the getResults method and return TRUE or FALSE based on what the categories numbers are. By default isAppropriate will return FALSE meaning the text is not appropriate if any of the categories scores more then a 0. The condition on what number needs to be scored for isAppropriate to return TRUE or FALSE can be configured in the settings form. Which can be found here /admin/config/azure_content_moderator.
Project information
- Project categories: Integrations
- Created by sstapleton on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

