https://github.com/suparnad/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/suparnad-comprehend_tagging
amazon-comprehend drupal drupal-11
Last synced: 10 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/suparnad-comprehend_tagging
- Owner: suparnad
- Created: 2025-05-14T02:00:20.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-05-14T21:30:36.000Z (10 months ago)
- Last Synced: 2025-05-14T22:28:47.626Z (10 months 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: 1.95 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.
---
## 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=eu-west-2
AWS_COMPREHEND_ENDPOINT_ARN=arn:aws:comprehend:...
---
## Enable
```bash
drush en comprehend_tagging -y
```
Save or edit an article node to trigger automatic tagging.
Testing
Create or update 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.