How to use OpenAI's GPT-3 to classify customer feedback

Learn how to use Open AI and GPT-3 inside the spreadsheet to classify customer feedback in Customer Support and Customer Success operations.

About OpenAI and GPT

OpenAI developed GPT, a type of artificial intelligence model that is capable of generating human-like text. It uses a machine learning technique called pre-training to learn the statistical patterns of a large dataset and then fine-tunes its knowledge on a smaller dataset to perform a specific task. It is trained on a dataset with billions of elements, including a significant part of the internet webpages, books and more.

GPT can be used for a variety of language-based tasks, such as language translation, summarization, question answering, and text generation. It can generate coherent and coherently structured paragraphs, articles, and even entire books, given a prompt or topic. GPT has the ability to learn and adapt to new tasks quickly, making it a powerful tool for natural language processing.

NOTE: There are known limitations to these models and the output is not guaranteed to be factually accurate.

What is Text Classification?

Text classification is the process of automatically assigning labels to text documents based on their content. It can be used to categorize customer feedback into different topics, such as customer satisfaction, product features, or customer service. This allows businesses to quickly identify areas of improvement and take action accordingly.

In this guide we'll explore how to use Rows and its OpenAI integration for text classification in customer feedback from NPS surveys, feedback forms or customer support emails.

How to use OpenAI in Rows

OpenAI template

There's a near-infinite amount of tasks you can solve using OpenAI. Follow this guide on how to set up the integration and use this template showcase to get started with 10 pre-built examples, follow along the list, or watch our video tutorial.

Using the ASK_OPENAI function

The OpenAI integration contains one function - ASK_OPENAI - that you can use to perform hundreds of tasks

You can use the ASK_OPENAI function via the Autocomplete in the editor, or via the Actions wizard.

ASK_OPENAI on the editor

The function has 4 parameters: 1 mandatory and 3 optional, with the following signature: ASK_OPENAI(prompt,[temperature], [max_tokens],[model]) prompt. Let's go one by one.


The prompt is the instruction to give to the model. This is where you'll enter the "ask" you want the AI to answer. You can use the prompt to solve a task by explicitly writing it in prose or you can use spreadsheet functions to concatenate values in different cells to construct the prompt. Examples:

  • Use =ASK_OPENAI("Population of France is, in millions, :") if you are not using any cell references inside the prompt.
  • Use =ASK_OPENAI(CONCATENATE("The population of ",A2," in millions, is: ")) if you're using A2 as an input (the country name) to the prompt.

Prompt creation with Concatenate

Temperature (optional)

The temperature is the sampling temperature to use, varying between 0 and 1. Use 1 for creative applications, and 0 for well-defined answers.

If you're doing tasks that require a factual answer (e.g. country populations, capitalize text), then 0 (the default) is a better fit. If you're using the AI for tasks where there aren't definite answers - such as generating text, summarizing text, or translating - then experiment with a higher temperature

Max_tokens (optional)

This max_tokens represents the maximum number of tokens to generate in the completion. You can think of tokens as pieces of words. Here are a few helpful rules of thumb examples from the Open AI Help center:

  • 1 token ~= 4 chars in English
  • 1 token ~= 3/4 words

You can use any number starting with 0. The default value is 200. Most models have a context length of 2048 tokens, except for the newest models which support a maximum of 4096. For tasks that require more text output - text generation/summarization/translation - pick a higher value (e.g. 250).

Model (optional)

The AI model to use to generate the answer. By default, it uses "text-davinci-003". You can see here a list of all of the available GPT-3 models.

Examples of ASK_OPENAI to classify customer feedback

There are several ways to use OpenAI to classify customer feedback:

  • NPS surveys: Tag responses to open-ended questions on NPS surveys into features, customer requests and product themes.
  • Feedback forms: Classify feedback form responses from customers into most requested features, issues and bugs.
  • Support emails: Tag customer support emails into the topic of the issue faced by the customer.
  • Classify sentiment in social media comments: Automatically classify the social media comments on your pages based on sentiment, emotions and opinions.

Tag NPS Survey responses

Goal: Tag responses to open-ended questions on NPS surveys into features, customer requests and product themes.


1=ASK_OPENAI(CONCATENATE("Classify the following text into tags around product features. Separate the tags with a ; . Text: ",A2))

Details: Assumes that A2 contains the NPS survey response.

NPS Survey

Prompts for text classification

The pre-trained LLMs (Large language models) such as GPT-3 can be extremely helpful at solving generic text classification tasks. However, to guarantee that the model classifies the customer feedback from a specific list of keywords that are the most relevant to your use, you can specify a closed list of tags in the prompt argument.

  • Example: '=ASK_OPENAI("Classify the following text into tags around product themes and features. The tags must from this list: 'Improvement','Bug','General Feedback','Reporting'. Seperate the tags with a ; . Text: 'Provide more detailed analytics and reporting capabilities.'))

Classify product themes in feedback forms

Sometimes you need to classify customer feedback into a pre-set list of options to simplify its reporting or to integrate smoothly into your CRM or downstream workflow. In this example we'll use the model to classify responses to a feedback form into a predefined list of tags.

Goal: Classify feedback form responses from customers into between a list of product themes or areas


1=ASK_OPENAI(CONCATENATE("Classify the following text into tags from this list: Delivery;Food selection;Customer Service;Price;Quality. Seperate the tags with a ; . Text: ,",A2))

Details: Assumes that A2 contains the feedback survey response.

Feedback form responses

Classify support emails for triage

Triaging emails is an important aspect of Customer Support operations both for the allocation of the agents, and for performance reporting. You can use the OpenAI integration to automatically tag customer support emails.

Goal: Tag customer support emails based issue type for triage and reporting.


1=ASK_OPENAI(CONCATENATE("Classify the following text into tags from this list: Order Status; Shipping; Return Policy; General Food; Defect; Price. Seperate the tags with a ; . Text: ",C2))

Details: Assumes that A2 contains the text from the customer email.

Support emails

Classify sentiment in social media comments

Goal: Analyze comments from social media accounts and extract the sentiment from the text.


1=ASK_OPENAI(CONCATENATE("Classify the sentiment of this post between 'Positive', 'Neutral' or 'Negative'. ,",A2," :"))


The use of the CONCATENATE function in the prompt creates the desired structure for the response:

  1. Starts with the sentiment types to be classified. You can add others to your implementation - e.g. 'Excited', 'Angry'.
  2. It adds the social comment to be analyzed (A2).
  3. It ends with : to prompt the AI to respond solely with the sentiment extracted from the text.

Sentiment analysis GIF

Alternatively, you can classify the sentiment in a numbered scale (e.g. 1 to 5). For that, specify in the prompt what the scale represents - e.g. "Classify the sentiment of this post from 1 to 5, with 1 being very negative and 5 very positive".