https://github.com/suparnad/comprehend_tagging
Drupal 11 custom module that uses Amazon Comprehend to automatically classify content and assign taxonomy terms using AI. Built with Drupal best practices and AWS integration.
https://github.com/suparnad/comprehend_tagging
amazon-comprehend drupal drupal-11
Last synced: about 2 months ago
JSON representation
Drupal 11 custom module that uses Amazon Comprehend to automatically classify content and assign taxonomy terms using AI. Built with Drupal best practices and AWS integration.
- Host: GitHub
- URL: https://github.com/suparnad/comprehend_tagging
- Owner: suparnad
- Created: 2025-05-14T02:00:20.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-19T21:39:45.000Z (about 1 year ago)
- Last Synced: 2025-05-19T22:29:58.014Z (about 1 year ago)
- Topics: amazon-comprehend, drupal, drupal-11
- Language: PHP
- Homepage: https://medium.com/@suparnad/ai-meets-drupal-auto-tagging-articles-with-amazon-comprehend-taxonomy-and-terraform-14b10cd575d0
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# comprehend_tagging
This Drupall 11 custom module integrates with Amazon Comprehend to automatically tag Drupal content using taxonomy, based on custom classifier predictions.
## DEMO [Youtube](https://www.youtube.com/watch?v=tAyicDTdmKw)
---
## Requirements
- Drupal 11
- A vocabulary named `ai_tags`
- A taxonomy reference field `field_ai_tags` on the `article` content type
- A custom Comprehend classifier endpoint deployed in AWS
---
## Environment Variables
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:...
---
## Enable
```bash
drush en comprehend_tagging -y
```
Go to [AWS comprehend repo](https://github.com/suparnad/aws_comprehend_for_auto_tag)
Download terraform files
Follow steps to [deploy](https://github.com/suparnad/aws_comprehend_for_auto_tag)
## Test
1. Create a taxonomy, vocabulary name AI tags (machine name : ai_tags)
2. Add that taxonomy to the Article content type.
3. Create an article with meaningful text in the body.
The module will:
1. Extract the body text
2. Send it to the Comprehend endpoint
3. Add or reuse a term in ai_tags
4. Attach it to field_ai_tags
4. Logs are written to Drupal’s watchdog if Comprehend is unavailable.