This Drupall 11 custom module integrates with Amazon Comprehend to automatically tag Drupal content using taxonomy, based on custom classifier predictions.
DEMO Youtube
- Drupal 11
- A vocabulary named
ai_tags - A taxonomy reference field
field_ai_tagson thearticlecontent type - A custom Comprehend classifier endpoint deployed in AWS
Use .env and vlucas/phpdotenv to load credentials:
AWS_ACCESS_KEY_ID = ... AWS_SECRET_ACCESS_KEY = ... AWS_DEFAULT_REGION = .... AWS_COMPREHEND_ENDPOINT_ARN = arn:aws:comprehend:...
drush en comprehend_tagging -yGo to AWS comprehend repo Download terraform files
Follow steps to deploy
-
Create a taxonomy, vocabulary name AI tags (machine name : ai_tags)
-
Add that taxonomy to the Article content type.
-
Create an article with meaningful text in the body.
The module will:
-
Extract the body text
-
Send it to the Comprehend endpoint
-
Add or reuse a term in ai_tags
-
Attach it to field_ai_tags
-
Logs are written to Drupal’s watchdog if Comprehend is unavailable.