Use Artificial Intelligence to automate the content creation process

Patrick van Kleef 2/29/2020 11:00:00 PM

For the majority of people, Artificial Intelligence is a futuristic technology that will change the way we do things. The reality is that it’s not so far away as people believe, as a matter of fact, it’s already integrated into our daily life in different ways. AI can be used for a variety of things, provide search suggestions when you start typing in Google, translation of text in several languages, face recognition, recommendations in Netflix and tons of other use-cases. A lot of applications we use today contain some kind of AI logic or are planning to implement this in the upcoming years. When we talk about AI we often mean a machine learning model that is trained with a big dataset. A rule of thumb is that the bigger the dataset the more precise the machine learning model. To simplify the implementation of AI in applications, major cloud players like Microsoft, Google and Amazon are offering AI services.

Microsoft released their AI toolset in the beginning of 2016. It includes a variety of different services and can be categorized into five different categories:

  • Decision
  • Language
  • Speech
  • Vision
  • Web search


Each of these categories includes a number of services that can be enabled in Microsoft’s cloud platform, Azure. It’s pretty straightforward to integrate these services into an existing application because those can be used by calling rest APIs. As with other cloud services this toolset works with a ‘Pay as you go’ pricing plan.

Automate the content creation process

Integrating AI services into new or existing applications can improve the efficiency of the end-user. Most of these services are taking over tasks that normally can only be executed by humans. By combining these services, we take it a step further and create a more sophisticated process. Let us, for example, take the content creation process and split that up into multiple steps. Below the process of a content creation team.

  1. Bill writes the text
  2. Lisa analyze the text and extract entities
  3. Daisy finds matching images for our text
  4. Paul moderates the text and images
  5. The page is ready for publish if Paul approved text

Writing text

Obviously, generating text is a very complicated process. For the sake of this article, we just let the editor manually write text. However, there are a few options for generating text as well like the GPT-2 model. In this article, we will work with the following text, source Wikipedia.

The Mona Lisa is a half-length portrait painting by the Italian Renaissance artist Leonardo da Vinci that has been described as “the best known, the most visited, the most written about, the most sung about, the most parodied work of art in the world.” The Mona Lisa is also one of the most valuable paintings in the world. It holds the Guinness World Record for the highest known insurance valuation in history at US$100 million in 1962 (equivalent to $650 million in 2018).

The painting is thought by many to be a portrait of Lisa Gherardini, the wife of Francesco del Giocondo, and is in oil on a white Lombardy poplar panel. It had been believed to have been painted between 1503 and 1506; however, Leonardo may have continued working on it as late as 1517. Recent academic work suggests that it would not have been started before 1513. It was acquired by King Francis I of France and is now the property of the French Republic, on permanent display at the Louvre Museum in Paris since 1797.

Define matching tags

Tagging the content is a good practice when creating content pages. Tags can be used for different purposes, search for related content, navigation and categorization. Usually, this process is not that complicated nor time-consuming. However, this process can be automated by using the ‘Text Analytics’ service from Microsoft. The text analytics service includes four services, sentiment analysis, keyphrase extraction, language detection and named entity recognition. The named entity recognition service can be used to identify entities in text. All entities are categorized into a predefined class and optional more information can be returned for example a linked Wikipedia article. If we take the previous text and call the service, the following entities are identified:

Mona Lisa [Person]
Renaissance [Organization]
Leonardo da Vinci [Person]
Guinness World Records [Organization]
US [Location]
100 million in [Quantity-Dimension]
1962 [DateTime-DateRange]
Lisa del Giocondo [Person]
Lombardy [Location]
King Francis [Person]
France [Location]
Louvre [Location]
Paris [Location]
….

Programmatically, we just need to shorten the list to end up only with relevant tags.

Select images

The next step in the content creation process is to find some good images. There are a few options to do this, create an image, buy a stock photo, or select an image from your DAM system. Most of the DAM systems already use AI to extract features from an image and allow users to search for the correct image. We can easily automate this step as well. We just take the most important tags and let the DAM system search for matching images. Another option is to search on the web for matching images. The Bing image search service is part of Microsoft’s Cognitive Services toolset. It allows us to search for images on the web by using some advanced filters. Basically, we can pass one of our tags to this service and enable some filters in order to search only for images that contain the correct license so we can use it on our website. Below the response when we search for Mona Lisa with the license filter on Public:

Content moderation

Usually, in the content creation process, an approval workflow is created so that different editors can moderate each others work before it’s published. This is convenient to make sure that no bad language is used or that the text doesn’t contain any grammar mistakes and is inline with the company standards. Writing content is a time-consuming task and so is moderating content. Fortunately, there are multiple AI services that we can use in order to automate. The Content Moderator service is part of Microsoft’s Cognitive Services and can be used to moderate text, images, and videos. We will use the text moderation feature to let Microsoft moderate the text that was written by a content editor. This feature use text classification to identify if any offensive, sexually or adult content was used. Worth mentioning is that it’s possible to upload your own list of terms that should be used when moderating the text. The service will return a likelihood between 0 and 1 which means the higher the score the bigger chance any undesired content was used.

Besides undesired content, we also want to make sure that our text isn’t written in a negative way by verifying the general feeling of the text. As explained earlier we use the Text Analytics service to analyze the text and extract entities. The same service can be used to analyze the text on sentiment. When we send the text, the service will return a score between 0 and 1. The higher the score the more positive the sentiment. If we combine the text moderator and text analytics service, we make sure the text doesn’t contain any undesired content and that the sentiment of the text is positive.

Until now, we only used Microsoft services, however, there are more cloud companies that are offering AI services. For moderating images, we will use Google’s Cloud Vision service. This service is also a collection of multiple features, for example, detect faces, objects, moderation, search and many more. Fortunately, the Microsoft Bing Search service already contains an option to enable ‘safe search’. This should eliminate the chance we get back images with undesired content. However, for this article, we let Google double-check this by using its Cloud Vision service. Basically, we send the image and get a result back that includes five categories, adult, spoof, medical, violence and racy. For each category, a score is returned:

  • Unknown
  • VeryUnlikely
  • Unlikely
  • Possible
  • Likely
  • VeryLikely

Publishing content

When all moderation services return a positive score, we can continue to the next step which is publishing the content. Of course, this can be automated as well but it depends on which CMS is used. Except for writing the content we managed to automate all other steps. This automated process will significantly speed up the content creation process. By applying AI to the process, we can let content editors focus on the thing that they are specialized in.

This article is just one example of how AI (is) will be integrated in our daily work. At some point this will be business as usual and we can’t imagine a world without the efficiency of AI.