---
url: 'http://workflows-of-ai.com/blog/categorize-content'
title: 'Categorize Content'
author:
  name: 'Marcus Johansson'
  url: 'http://workflows-of-ai.com/about/marcus-johansson'
date: '2023-10-14T15:27:46+02:00'
updated: '2026-10-10T12:14:04+02:00'
type: article
summary: 'Use the AI Interpolator OpenAI taxonomy rule to have GPT-3.5 tag Drupal articles with terms from an existing vocabulary, like phone brands.'
tags:
  - 'Marcus Johansson'
  - Workflows
  - 'Drupal AI'
image: 'http://workflows-of-ai.com/sites/default/files/previews/eeea4ec877851bc5.jpg'
published: true
og:
  site_name: 'Workflows of AI'
  'image:width': '1280'
  'image:height': '720'
  'image:alt': 'Categorize Content'
---
Drupal AI

# Categorize Content

Let AI pick the right taxonomy terms for your existing articles, here the phone maker each article is about.

  Marcus Johansson

October 14, 2023 · 1 min read

 ## About this video

The workflow for categorizing an article using the AI Interpolator OpenAI module, in this case, is tailored to match the content against a fixed list of categories. A user submits an article, and OpenAI's algorithms go to work, examining the content, keywords, and context to identify the predominant themes.

These themes are then matched against a predefined list of categories. The algorithm selects the category that aligns most closely with the article’s content. It’s a precise, automated process that ensures each article is accurately categorized according to the established criteria, streamlining content organization and accessibility.

*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: Categorize Content](https://www.youtube.com/watch?v=cotaZwTHEKc)

### Video chapters

- 0:00 Why categorize old articles
- 1:43 The mobile provider vocabulary
- 2:23 Adding the taxonomy field
- 3:05 The OpenAI taxonomy rule
- 4:29 Resaving the article

## Transcript

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

### Transcript

- 0:01 hey there uh Marcus here um this workflow is one of the those that are very easy but also very powerful uh so the idea is basically this you have some old article or you
- 0:14 might have thousands of article that's rather the case right and you realize oh I needed to categorize them in some way because you want to make your search engine internal search engine better or
- 0:29 uh maybe you want to show you know the typical block with related articles to this article which is very easy when you have have article um categorized in different
- 0:42 ways so that's what we're going to do and in this case we're going to use the system that is built into Drupal that's called the vocabulary taxonomy system uh and yeah I should start with
- 0:56 saying this is Drupal you're seeing in front of you a Content management framework work um it's just vanilla with one article type and one article is everything I added there's the AI
- 1:06 interpolator module if you want information on how to set this up look into the uh video description uh there's soon going to be some information there on how you can
- 1:16 set it up and um that's basically it let's get started oh I will also say this is open source this is free if you like what you see you can download it and you can do
- 1:30 whatever you want with it it's free to use um so we start by logging in and I will just show you that I also prepared a taxonomy called uh yeah it's mobile phone provider provider I just
- 1:48 called it um uh because you saw that article I saw before maybe you didn't see it was about Apple so of course I could you know set Apple on that article but if I have thousand or tens of
- 2:02 thousand or hundreds of thousands it's um a daunting job um even for an intern adting job but this is something where AI just does it very easily and at a very low cost and at a
- 2:19 very uh well it's very Speedy actually so we're going to go to this content type and add um this taxonomy field to it now so we're going to add a taxonomy term called we call it mobile provider
- 2:33 here so but we're going to use this provider taxonomy we say that you can check multiple uh that makes little sense in this case but we do it anyway just to make sure that it actually works it
- 2:49 doesn't check Samsung and Apple for instance um because well it could make sense because if you have news article where you're comparing Samsung and Apple then you want to check both of course
- 3:02 which chose the provider uh vocabulary and here we enable the AI interpolator and then there is this OpenAI Taxonomy we're going to use the base mode and use the article as the context in this case
- 3:16 I'm actually going to just inspect here so I can uh copy this placeholder because it's actually pretty good let's copy everything so uh because that's basically all we need
- 3:32 based on the Contex text choose up to max amount uh this has no actual value now because we set unlimited so we say two categories from the category context that fits the text category options and
- 3:48 then you see value options comma so this is a placeholder that basically shows all the categories that's available that you can choose from and then the context
- 3:59 is start article right uh if you can try this on a couple of article if it doesn't give good responses with GPT 3.5 you can use GPT 4 it basically depends on the uh
- 4:14 complexity of the text and complexity of the category but in this case the text is very straightforward uh and the category of choosing the brand is very straightforward so we just keep it at
- 4:26 3.5 um and this should basically be it if we go now to our content then and resave it it oh let's do this into a checkbox so it looks a little bit nicer but this out
- 4:40 the complete field so we go to manage form display and we say that the mobile provider should be checkboxes radio buttons instead reload so you see we have the M
- 4:52 mobile provider but nothing is filled out so we save it and then we click edit again it's 35 so it goes very fast as you see and Apple is filled in so that's a very
- 5:05 simple workflow but a very powerful where you can fill out categories automatically um yeah thanks for 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

A mobile provider vocabulary is added to the article content type as a taxonomy field. The OpenAI taxonomy rule reads the article and picks up to two terms from the vocabulary, using the default prompt and GPT-3.5. Resaving an article about Apple fills in Apple within seconds.