This module integrates with Microsoft's Azure Content Moderator service to help filter profanity and other inappropriate content. It allows you to send text to the service and receive a score indicating the level of potential issues, or simply determine if the content is appropriate based on configurable thresholds.
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.
Ask your assistant about Azure Content Moderator
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | 9–10 | Dec 19, 2024 |