Yielding to the herd instinct, I began to explore the possibilities of GPT from OpenAI. I didn’t want to sit in a chat with him all the time, so I started looking in the direction of the api. According to ChatGPT itself, its API can be used for a number of different tasks, such as:

  1. Creating a Chatbot: You can use the ChatGPT API to create a chatbot that can communicate with users in natural language. This can be useful for many applications, such as helpers for finding information, ordering food or tickets, communicating with customers, and much more.
  2. Text Generation: You can use the ChatGPT API to generate text based on user input. This can be useful for creating new articles, product descriptions, social media posts, and more.
  3. Auto-completion: You can use the ChatGPT API to automatically fill out forms and fields based on user input. This can be useful for speeding up the process of ordering products or processing requests.
  4. Model Training: You can use the ChatGPT API to train your own model based on your corpus of text data. This can be useful for creating your own model that will specialize in specific tasks.
  5. Text Analysis: You can use the ChatGPT API to analyze text, including sentiment detection, keyword extraction, named entity recognition, and more. This can be useful for monitoring social networks, analyzing customer feedback, and so on.
  6. Language research: You can use the ChatGPT API to explore the language and create apps that can help you learn foreign languages or develop your language skills, such as apps for learning foreign words and phrases, grammar training, etc.

It seems to me that the first two possibilities have captured most of the public’s attention. Demand is growing every day:

Everyone is interested in being able to create something out of nothing.

However, in my opinion, GPT is not suitable for many tasks. For example, it doesn’t have a fact-checking function, so it can make mistakes when doing many things that at first glance it seems to be able to do.

A simple rewrite function (for example, a news item or research article) cannot be performed efficiently. The text it creates will be logical, grammatically correct, and so on, but it will not be a retelling of the same information that was in the original document. Instead, it will simply generate the words that he thinks should be in this text, and be in it in a certain order. You will notice this only by checking the source and created texts character by character. But at the same time, he can write a wonderful astrological forecast, and you will not understand what the catch is, because you will have nothing to compare it with.

After collecting these observations — I decided to treat the generation function with caution for the time being, and to a greater extent observe whether it is possible to make something simple and useful based on its analytical functions.

Among the suggested usage examples on the OpenAI website is «Keywords»:

Extract keywords from a block of text. At a lower temperature it picks keywords from the text. At a higher temperature it will generate related keywords which can be helpful for creating search indexes.

https://platform.openai.com/examples

There’s also a sample text and code samples…

Keywords for SEO would be somewhat banal to do. I decided to make tags. The same ones that you can use to tag articles in wordpress. Surprisingly, I didn’t find anything like this in the wordpress catalog, although there are already plenty of plugins for generating entire articles.

These plugins are quite cumbersome, with a lot of settings right on the page of writing a post. I decided to make mine only with a minimum of basic settings, on a separate page of the plugin.

It turned out minimalistic:

  1. Writing an article
  2. Click «Save»
  3. Tags are automatically added to the article

On the settings page, only the api key, the field for maximum token consumption per request, and the» temperature » of creativity are displayed. Promt itself is embedded in the code.

Depending on how to formulate it, the result of the plugin will also change. Regardless of what I ask you to give me, it should always be issued in the same format (for further processing), so I ask you to give me the results in the form of «Give me a numbered list».

Then it is quite free — you can request to issue

  • tags
  • words
  • phrases
  • hashtags
  • entities
  • etc.

Each of the options determines what you get, and in what form:

  • hashtags for example will start with a # and be written in lowercase
  • entities will be selected based on the persons, organizations, places, etc. mentioned in the text.
  • you can also ask them to use the most frequent words, such as long or short ones, without conjunctions or prepositions, and so on.

If you want, you can play around with restrictions on the format of the list item, the length of the item, or the entire list.

As a result, the final request may look like this, for example:

Give me a numbered list of up to 10 tags for this text

or so:

Extract the 5 to 10 most frequently used words from the provided text, excluding prepositions and conjunctions. Please provide them to me in a numbered list format

We glue this line with the text of the article and send it to the api.

We split the received successful response into lines, remove the line numbering, validate it, format it, and attach it to the post as tags.

Well, it is clear that all this works well only in English.

If you are interested, the code is available on github — https://github.com/pamnard/wordpress/tree/master/wp_taggen