An open API service indexing awesome lists of open source software.

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.

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.