Hello Drupal fanatics! Welcome to "Drupal & AI Adventures. In this series, we explore the fantastic world of Drupal modules powered by artificial intelligence. Our mission? We want to inspire and enlighten YOU. We'll dive in together! This time, we're talking about Emotion detection.

ai tree

Sentiment analysis

Sentiment analysis is a part of AI. You have 2 main variants of this:

  • Textual
    This falls under NLP (natural language processing). You can run this yourself using a model from huggingface (for example, t5-base-finetuned-emotion). Or you can use a CLoud model for this. Azure offers this for several languages with their "Language sentiment detection". 
  • Images
    With advanced image models, we can also detect emotions in faces. The well-known cloud services have been offering this for years. 

Did you know?

Did you know that we can super easily filter images based on what's on them?

Sentiment analysis in text

Sentiment analysis

This sentiment analysis allows you to discover what users think of your platform by analyzing raw text for indications of positive or negative sentiment. The API provides a numerical score between 0 and 1. Scores close to 1 indicate positive sentiment, and scores close to 0 indicate negative sentiment. The sentiment score is generated using classification techniques. 

sentiment analyse in afbeeldingen

Sentiment analysis in images

We can also extract interesting information from images. For example, the Azure API returns whether someone looks angry/apologetic/angry/joyful/neutral/ sad or surprised. 

 

google vision classification

You can therefore integrate these filters into your applications if you wish. Suppose you want only happy photos on your website.

Or you have a site with Pizza reviews. Then you don't want pictures of pies. 🤔

Pie is not pizza
Ai image models

Notes on these modules

azure_emotion_api

The Emotion API beta takes an image it trusts over a set of emotions for each face in the image, as well as a frame for the face.

azure_text_analytics_api

Supported module that can use the azure text ai models.

google_vision

  • Tagging of image files using Label Detection
  • Safe search: Tagging of explicit/violent content.
  • Filling Alt Text attribute of image file.
  • Emotion Detection - If you don't want your site users to upload sad/unhappy images as their profile pictures.
  • Similar image files

 

google_cloud_vision

Rather a simple API integration of google vision with Drupal. 
This module is for developers.

vision

A beta project, which no longer seems to have been maintained.

Blue ai drupal logo

Personal note

There is a new central Drupal AI module. This module is in alpha, but is going to change the ecosystem soon. These vision modules are not yet integrated, but this is a matter of time.