---
url: 'http://workflows-of-ai.com/blog/auto-tagging'
title: Auto-Tagging
author:
  name: 'Marcus Johansson'
  url: 'http://workflows-of-ai.com/about/marcus-johansson'
date: '2023-11-13T09:41:52+01:00'
updated: '2026-10-10T12:14:04+02:00'
type: article
summary: 'Auto-tag Drupal articles with AI Interpolator and OpenAI: a tags field that creates three to five new terms from the body text.'
tags:
  - 'Marcus Johansson'
  - Workflows
  - 'Drupal AI'
image: 'http://workflows-of-ai.com/sites/default/files/previews/2768059e26c9e858.jpg'
published: true
og:
  site_name: 'Workflows of AI'
  'image:width': '1280'
  'image:height': '720'
  'image:alt': Auto-Tagging
---
Drupal AI

# Auto-Tagging

Have OpenAI read an article and create free tags as new taxonomy terms, ready to run over thousands of articles.

  Marcus Johansson

November 13, 2023 · 1 min read

 ## About this video

This workflow is very simple - you have a text body that you want to read, analyze and create some free-text tags for.

It uses the OpenAI Interpolator module that reads the text and then generates X amount of tags that are created as terms and set on the field. As long as you have allowed entity references to be created on your taxonomy field, it should be possible.

The end result is that you can take 1000s of articles and have them free-tagged within 1 hour. Pretty neat.

*This video is from before the AI Interpolator module became AI Automators, part of the [AI module](https://www.drupal.org/project/ai). Module and menu names have changed since, and some steps look different today.*

## Watch the video

[Watch on YouTube: Auto-Tagging](https://www.youtube.com/watch?v=IrsooHJoYOE)

### Video chapters

- 0:00 Tags for an article
- 1:46 The tags field settings
- 2:09 Taxonomy rule and prompt
- 3:48 Saving and checking the tags

## Transcript

YouTube's automatic captions, lightly corrected. Click a line to jump to that moment in the video.

### Transcript

- 0:01 hey there Marcus here um today's workflow is going to be very specific for Drupal so if you're just interested in using the AI Interpolator for chaining uh AI tools and manipulating
- 0:13 content and not interested in the CMS part of Drupal this will not be interesting for you but if you're a Drupal developer working with Drupal as the classic CMS cmf this uh it's a very
- 0:25 simple tutorial where we would take an article with a text and uh generate uh tags for it so this is just a base Drupal with I've added admin toolbar but otherwise no other modules and the AI
- 0:41 interpolator module and the AI Interpolator OpenAI in this case so what we want to do is take this article I just copied something from some website about Iceland uh declaring state
- 0:51 of emergency over Volcan threat of volcanic eruptions and I want it to be auto tag with tags like Iceland I'm I'm guessing and maybe emergency um but I don't want to do this
- 1:04 myself because maybe I have thousand articles and I realize oh I need to tag this and this takes forever so let's use AI for it so we start off very easy we log into our uh
- 1:18 environment I can just show you the content before we start manipulating Fields so there's a image that comes here as well but I haven't filled out that and then you see there's tags and
- 1:28 this is what we want to fill in in so a normal workflow would be something like this right that we start generating stuff but in this case uh we're going to do this
- 1:40 automatically then with AI so there is this tags field and what's important to remember with this it has unlimited number of values so we can generate multiple tags uh and it also have set create
- 1:57 reference entities if they don't already exist with means we don't have predefined tags in this case you can actually write whatever you want and this is going to create a taxonomy
- 2:05 entity for that so what we do here is that we're going to enable the AI Interpolator use the taxonomy Rule and use the article as based base uh and what we can do here is we're
- 2:22 actually just going to copy this prompt that's inside here uh because it's pretty good actually for our use case so what this says is based on the context choose up to
- 2:40 uh we say three to five categories from the category context that fits the text category options value options comma oh sorry in this case it doesn't fit this because this would be based on
- 2:54 us having categories so in this case we're not going to write this what are we're going to write instead based on the context text create up to five 3 to five uh
- 3:14 tags that fits the text content of course you can set whatever number you want there depending on what you want to do uh and this is a very basic prompt now of course you should better this so
- 3:29 it actually fits your purpose um in this case this the only thing we're going to do so we set 100 we set direct we can take gp4 uh so we get a little bit better um
- 3:45 result we have moderation on and then we save and now if we go and resave hopefully that's it basically it's going to fill out tags and it's going to generate them as
- 3:56 well so we're saving here and if we go back you see it has created Iceland earthquakes volcanic eruption emergency EV evacuation civil Protection Agency uh of course I could be I should
- 4:14 have been uh maybe more exact that I wanted it to always have uh capital letter in the beginning of a tag uh and so on but this is basically it it's generating the tags because we have set
- 4:30 it that it should create the tags it's going to create them as well uh and that's it basically very simple workflow but also very powerful workflow thank you for
- 4:45 watching

  Filed under [Workflows](/blog?category=6) [Drupal AI](/blog?category=2)

Parts of this content were produced by AI.

This site has not assessed whether a label is required for this content.

  How was AI used?The video and the introduction are Marcus's own, first published on workflows-of-ai.com. AI wrote the subtitle, the summary and the video chapters from the transcript, and corrected misheard names in YouTube's automatic captions.

   Marcus Johansson

Tinkers with AI and Drupal

 [About Marcus](/about/marcus-johansson)[Drupal.org profile](https://www.drupal.org/u/marcus_johansson)[Drupal AI](https://www.drupal.org/project/ai)

## The post in three sentences

Marcus takes an article about Iceland's volcano emergency and lets AI Interpolator fill the tags field. The field allows unlimited values and creates missing terms, and the taxonomy rule gets a prompt asking for three to five tags. Saving the article creates tags such as Iceland, volcanic eruption and evacuation.