How to get keyword Search Intent with AI

Table of contents

We continue in the iSocialWeb blog, with the series of articles on automations using artificial intelligence. It is the turn of a Python script that will allow you to classify, obtain the search intent and identify the stage of the funnel in which the user is from a list of keywords.

You know how important search intent and entities are in SEO.

That’s why in this script, created by Álvaro Peña, you will be able to extract both from a list of keywords.

If this sounds like science fiction or a complicated task, we can tell you that you don’t need any programming skills. It is easy to use and anyone can use it.

We have even prepared a video to support the less experienced user.

Also, if you know how to program, feel free to change it to your liking and if you can mention our authorship. Remember: Good Karma is Good to everyone.

Automating artificial intelligence with Phyton

The first thing you should know is that the script will run on Google Colab.

A free Google tool that allows you to run code in the cloud.

Also, clarify that Python is a very simple programming language and the standard for this type of task.

Let’s see now the functions of the script:

Script functions

  1. Import keywords from keywords.csv file
  2. Detects entities.
  3. Classifies the user’s search intent.
  4. Determines the stage the user is at in the conversion funnel.

Well, as you can see, the code performs 4 tasks that otherwise could take hours.

A great idea, don’t you think?

Now let’s see the steps you need in order to take advantage of something so powerful.

Steps prior to the execution of the script:

In order to work with the script, you will need an OpenAI API key and a list of keywords in a CSV file called “keywords.csv”.

It is important that the file name is exactly “keywords.csv”.

This is the name that will be called within the Colab code and the first row should have a column called “keywords”, which will be the header and where the list of keywords will be found.

The script will run the CSV file and use OpenAI to sort the keywords.

It will then do a series of cleanups to format them properly.

Therefore, you need to have an API KEY and enter it into the Colab.

How to run Python code in the browser with Google Colab

The advantage of Colab, also known as Colaboratory, is that it allows us to share content programmed in Phyton and run the code easily, whether you are a student, data scientist or AI researcher.

Let’s take a look at the next steps:

  1. Save an archive copy of Google Colab from the File menu in your Drive.
  2. Install dependencies that Google Colab needs to run the program in your browser by running first cell. 
  3. Import the file named keywords.csv with the template provided in this article into the folder located in the side menu. If you change the name, don’t forget to reference the new name in the Google Colab file. 
  4. If it has been executed successfully, a green checkbox will be displayed. Do not proceed to the next step, until that check is displayed. 
  5. Add OpenAI API key. If you don’t already have one, you can create OpenAI APIs for free.
  6. Make a batch with the total number of keywords. 
  7. Create empty lists that we will use to incorporate information, once the words have been classified according to their intention and stage of the sales funnel.
  8. Run Prompt: “For the following list of words: return for each of the keywords the search intent [informational, transactional or navigational] and the stage of the conversion funnel [discovery, consideration or conversion]. There will be one word per line in the format: Keyword | Intent | Stage”.
  9. If you have been able to complete the various coding instructions, it will return a table of keywords sorted by search intent and stage in the sales funnel.

To help you understand the script better, here you can watch a video with a demo of the process:

Where do I find the script to rank the search intent of your keywords publish content by AI in wordpress?

You can access Alvaro’s script below:

Access the Google Colab here

We also leave here the CSV file to upload in the colab using our template: 

Template keywords.csv

What problems can I encounter when executing content scripting?

There are some problems that you may encounter when working with the programme that may prevent it from working properly. However, some of them can be solved by simply following the step-by-step process and carefully reviewing the video.

There are also external problems that may occur:

  • CSV encoding: Sometimes, the CSV file is generated with a different encoding or contains elements that contaminate the document and make it unreadable. To solve this problem, you can use a demo file to test the tool.
  • OpenAI’s availability problems: Sometimes OpenAI may crash and not return data, especially during US hours. This can cause a program crash, as it will not receive the necessary data in the request to the GPT AI.

What are entities in artificial intelligence?

Well, entities are objects or concepts that are used to describe information in content and are very relevant in the development of artificial intelligence applications.

For example, an entity can be a person, a place or a product.

Entities are used to identify and classify information in a corpus of data, which facilitates data processing and analysis by AI.

What is the relationship between entities, search intent and sales funnel?

There is an imply relationship between entities and sales funnel because both are essential for a successful SEO strategy.

Entities help search engines understand the content, contextualize search intent and establish the main topics of a web page.

On the other hand, the sales funnel helps companies understand where the user is in relation to their purchase decision and therefore helps define how to attract and retain potential customers.

Together, these two elements allow companies to improve their search engine rankings and increase online visibility.

Can the search intent of a keyword change?

The search intent of a keyword can change over time.

As John Muller confirmed to us: Yes, there are always changes in the way queries are treated (and how users expect them to be treated): the static “assignment” of an intent to a query is sometimes incorrect.

Hence, the importance of being able to automate the manual review of purchase intentions for thousands of terms and keywords. Given that this is a process that needs to be executed several times a year and in some cases periodically.

Do you now understand the value of automating with python and taking advantage of AI in SEO?

Now, we are sure you do!

We hope you get the most out of our script and give us some love on social media.

So please, share this post with your friends and professional colleagues to help them and let us know if it has helped you!

References and bibliographical sources

Want to improve the performance of your sales funnel and increase the SEO relevance of your entities? We can help!

Our specialized AI team, uses artificial intelligence automation to identify and optimize the entities relevant to your business and maximize their impact in the sales funnel.

Would you like to improve your project?