---
url: 'http://workflows-of-ai.com/blog/summarize'
title: Summarize
author:
  name: 'Marcus Johansson'
  url: 'http://workflows-of-ai.com/about/marcus-johansson'
date: '2023-10-13T22:50:05+02:00'
updated: '2026-10-10T12:14:04+02:00'
type: article
summary: 'Summarize articles in Drupal with the AI Interpolator and OpenAI: a long text field becomes a two-sentence summary when you save.'
tags:
  - 'Marcus Johansson'
  - Workflows
  - 'Drupal AI'
image: 'http://workflows-of-ai.com/sites/default/files/previews/59273e6f9984094e.jpg'
published: true
og:
  site_name: 'Workflows of AI'
  'image:width': '1280'
  'image:height': '720'
  'image:alt': Summarize
---
Drupal AI

# Summarize

Have AI write a two-sentence summary of an article when you save it, ready for previews and listings.

  Marcus Johansson

October 13, 2023 · 1 min read

 ## About this video

Using the AI Interpolator OpenAI module for text summarization is straightforward. You input a lengthy text into the system, and the integrated OpenAI algorithms analyze and process it. The complex text, be it an article or report, is sifted through to extract the main ideas and crucial information. It’s a direct application, with the focus solely on reducing the volume of the text while maintaining the core message.

The result is a concise summary that encapsulates the primary information and insights of the initial text. This short, coherent version is easily digestible, allowing users to quickly grasp the key points without wading through pages of content. It's a practical, no-frills approach to condensing information without losing its essence.

*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: Summarize](https://www.youtube.com/watch?v=Xr-5ms2Nbzk)

### Video chapters

- 0:00 Summaries for article previews
- 1:00 Creating the article content type
- 1:38 Adding the summary field
- 2:30 Setting up the AI Interpolator

## Transcript

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

### Transcript

- 0:01 hey guys Marcus here uh easiest workflow ever we're just going to summarize something typical use case you have a article in a CMS you want to show a preview in some listing or something and
- 0:13 maybe you just want to show one or two sentences what that article is about as always this is Drupal content management framework Delux can do anything around content makes great content Management
- 0:25 Systems as well uh on top of that you have the AI Interpolator the module I built if you want to know more about how you install that what it is uh check the check the uh description of the video
- 0:41 and it's open source free just you can just take the code you can download it you can run it on your own computer you can set it up in the cloud you can sell it commercially if
- 0:52 you want feel free to take what I did and take especially what Dries did with Drupal which is great so let's get started we log in we log in here and what are we going to do
- 1:08 after that is create a new content type in this case we just create a article so this is a typical CMS use case as I said we create the article that should have an article text so we
- 1:21 just remove what comes with nodes by default which is the body so in this case we do article text save it it should just be one and we have to require it you have to fill
- 1:34 in a article otherwise we can't create a summary because there's nothing to summarize create next field which is the summary then uh and this is another takt formatted log it doesn't have to be
- 1:49 formatted there's no necessary need for HTML right so just so you understand so far if I go and create the content this is normal Drupal now so I could actually fill out the title
- 2:02 I'm just going to steal something here I used it in another video uh CNN writing about the AI let's just we don't have to take everything here put that in and then I could of course now manually
- 2:17 write my summary based on the text because I probably wrote the text so I might be able to write a good summary but in this case I'm just going to save this and we want to autograde it there
- 2:29 right so if we jump back here we have the summary it's going to be full HTML and we're going to enable the AI Interpolator use the text long so that takes text and creates text use the base
- 2:43 mode because we only need one context and that context is the article text uh and we can even steal what was in the placeholder there based on the context create a sum summary that
- 3:01 is between no let's say two sentences long context and then we fill in the context so this is going to replace this context now with the article then right we just send this to OpenAI we don't
- 3:18 really need to change anything we can use three5 it's good at summarization or no let's do GPT 4 we say direct because this is we are not chaining any anything we don't need to
- 3:30 see any progress It's just going to do this one thing now when we click save here then so this is set up now when we click save now it's going to do a request OpenAI to summarize this going
- 3:41 to fill in that field under here with two sentences of a summary that we can use in a preview that is a summarization very very easy uh but still needs to be done thank
- 3:57 you 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

An article content type gets a required article text field and a summary field. The summary field uses the AI Interpolator OpenAI text rule in base mode, with a prompt that asks for a two-sentence summary of the article text. In direct mode with GPT-4, the summary is filled in when the article is saved.