When using Displayr for text categorization, you can significantly enhance the quality and relevance of your results by incorporating AI-based custom prompts. You will find a number of examples below containing different ways to use AI-based custom prompts to assist with theme creation and text classification. These examples are just a sample of what can be done using custom prompts; with AI, the possibilities are nearly endless!
- Customize the prompt used to create the themes
- Customize the prompt used to classify responses into themes
- Customize both prompts - theme generation and classification
If you need any tips about optimizing your AI prompts, see Getting Started with OpenAI Prompting in Displayr.
Why use a custom prompt when generating themes?
When comparing AI outputs with and without a custom prompt, the AI-based custom prompt method doesn’t create themes for responses with little input or no strong preference. It only focuses on the main topics mentioned. On the other hand, without a custom prompt, the built-in AI generates themes for both the main topics and a separate theme for "No preference or unclear" for those responses.
Why use a custom prompt when classifying responses?
When comparing AI outputs with and without a custom prompt, the classification with the AI-based custom prompt is more accurate and contains fewer mistakes. By using the "Sort by Similarity to" algorithm to analyze the results, the classification with the custom prompt better matches the similarity results, showing that it improves accuracy.
Text Categorization isn’t for Spontaneous Awareness data
The text categorization tool is not designed to generate themes from brand mentions or spontaneous awareness responses. For more accurate and effective results, we recommend using the Automatically Classify Lists of Items feature, which is specifically built for this purpose.
Requirements
- A text variable (represented by an "A" in the Data Sources tree)
Customize the prompt used to create the themes
You can use AI-based custom prompts to create tailored themes that align with your specific use cases. Below are some different approaches and examples for generating themes effectively.
To use a custom prompt to create themes, the steps are:
- Select the text variable in the Data Sources tree.
- Hover and click + > Text Categorization.
- Select Only one theme or Multiple themes based on your needs.
- Click Start.
- Click Create.
- Tick Custom prompt.
- Enter your custom prompt in the prompt text box.
- Click Create.
Automatic selection of the number of themes
In this example, instead of indicating exactly how many themes to create, we'll allow AI to decide how many themes are necessary.
I have some data about people's thoughts about France. I will use the custom prompt below to let AI determine the number of themes based on the content diversity.
Custom prompt:
The task is to group similar responses from a survey titled 'Thoughts about France' into an appropriate number of categories.
The number of categories should be determined based on the variety of themes present in the responses, ensuring the grouping is neither too broad nor overly specific. Aim for a balanced categorization that accurately reflects the diversity of opinions while maintaining clarity and coherence.
The themes created based on the prompt are:
Themes that combine sentiment and topic
Prompts can be used to create themes based on sentiment (positive, negative, neutral) and identify the factors that cause each sentiment.
Example 1:
Using the same data as above, survey responses about France can be grouped by sentiment (positive, negative, neutral) and the reasons behind them, such as “Positive – Famous landmarks” or “Negative – Arrogant attitude.”
The prompt used is:
The task is to group similar responses from the survey question "Thoughts about France" into exactly 10 categories. Each category must begin with the sentiment (Negative, Positive, or Neutral), followed by a hyphen (-) and a concise theme that summarizes the main topic of the responses. Ensure that the categories cover a diverse range of themes while maintaining clarity and relevance.
Format for each category:
- Sentiment: Negative/Positive/Neutral
- Theme: A brief description of the main topic of the response.
Example category:
Negative - The locals' attitude is bad.
And here are the themes created using the prompt:
Example 2:
In addition to survey responses grouped by sentiment (positive, negative, neutral), you can include topics in the prompt in a single step.
Here's the prompt:
The task is to group similar text into around 10 categories. The text has been generated from a survey. The survey asks "Thoughts about France". I want you to create three types of themes:
- If somebody only gives their sentiment but not topics, create themes based on sentiment.
- If they only mention topics, but not sentiment, classify based on sentiment.
- If they mention sentiment and topic, create themes that reflect both.
And here are the themes that were created using the custom prompt that also incorporated topics:
Hierarchical themes
Use the custom prompt to group responses into primary themes and their related sub-themes for more detailed analysis.
Example:
Survey responses about France can be categorized into main themes like "Culture and Heritage," with sub-themes like "Landmarks" and "Museums.”
Using the prompt:
The task is to group the survey responses, which are generated from the question "Thoughts about France," into exactly 10 categories. Each category must begin with the main theme, followed by a “-” and the sub-theme. Ensure that the categories are distinct, meaningful, and logically structured, capturing the diversity of opinions while avoiding redundancy.
Format for each category:
- Main Theme: A broad category that represents the general topic of the responses.
- Sub-themes: Specific reasons that contribute to or elaborate on the main theme.
Example category:
Culture and Heritage - Art and Architecture
AI used the custom prompt to create the following themes:
Context-rich themes
Create specific themes that provide deeper insights into responses, rather than using vague, generic themes.
Example:
Instead of broad terms like "Food," refine themes to something like "Love for French Pastries.”
Custom prompt:
Group the survey responses to the question 'Thoughts about France' into distinct and meaningful categories. Prioritize specificity by ensuring that each category accurately captures the nuances of the responses rather than being overly broad or generic. The number of categories should be flexible and determined by the diversity of themes present in the responses.
For example, instead of a general label like 'Food,' refine it to reflect more precise sentiments such as 'Admiration for French Pastries' or 'Disappointment with Restaurant Service.' If responses reflect multiple distinct viewpoints within a broad category, create separate categories rather than forcing them into one.
And here are the themes that were created based on the prompt:
Industry-specific/Topic-specific themes
Use custom prompts to generate themes relevant to a particular industry or topic.
Example 1:
For a tourism business, themes could include "Eiffel Tower and Related," focusing on travel-related insights.
Custom prompt:
The task is to group similar text into exactly 10 categories. The text has been generated from a survey. The survey asks "Thoughts about France".
Context: I am analyzing a survey for my client, a tourism business based in France (https://www.france.fr/en/). The goal is to gain insights into people's opinions, interests, and preferences about France, allowing me to recommend the most relevant tourism activities and experiences. The categories should capture key themes and specific interests, providing actionable insights that can guide business decisions. This analysis will help identify the most appealing activities and experiences for potential visitors, ultimately shaping strategies to better serve clients in the tourism sector.
Themes created using the custom prompt:
Example 2:
In this example, we'll use slightly different data about cola attitudes. Themes could focus on consumer concerns about sugar content, calorie intake, and the demand for healthier or low-calorie alternatives in soft drinks.
Custom prompt:
The task is to group similar text into exactly 10 categories. The text has been generated from a survey. The survey asks "Differences in Cola Drinkers".
Context: I am analyzing survey responses for my client, an FMCG company specializing in soft drink products. The goal is to extract insights regarding consumer preferences for soft drinks to help generate actionable recommendations. The categories should reflect key themes and specific interests, incorporating relevant FMCG industry terminology to inform business decisions.
Simple and clear themes
Create clear and easy-to-understand themes by using simple language and avoiding technical jargon.
Example:
Survey responses can be categorized into themes using plain English that is clear, straightforward, and free of complicated terms.
Custom prompt:
The task is to group similar text into exactly 10 categories. The text has been generated from a survey. The survey asks "Differences in Cola Drinkers: Jan-Feb Only".
- The categories should be in plain English, easy to understand.
- Avoid using technical language or vague terms.
- Each category should clearly represent a specific idea or theme based on the survey responses.
Unique and non-overlapping themes
Use AI-based custom prompts to ensure that the new themes you generate are distinct from existing ones, maintaining diversity and preventing redundancy.
Example:
In this example, I have two themes that were already created: Eiffel Tower and Fashion. When classifying public opinions on France, I want to avoid creating categories like "Eiffel Tower" or "Fashion" if they already exist.
Custom prompt:
The task is to group similar text into exactly 10 categories. The text has been generated from a survey. The survey asks "Thoughts about France".
The bot should avoid creating categories that are similar to or overlap with the following existing categories: Eiffel Tower, Fashion.
Customize the prompt used to classify responses into themes
Use custom prompts to classify responses into themes - whether manually created or AI-generated - to match your specific use cases. To manually create themes in the Text Categorization module, select "Add Theme" in the Themes pane, enter a name, and click "OK."
To use a custom prompt when classifying responses, follow these steps:
- Select the text variable in the Data Sources tree.
- Hover and click + > Text Categorization.
- Select Only one theme or Multiple themes based on your research needs.
- Click Start.
- Click Create.
- OPTIONAL: Tick Custom prompt.
- OPTIONAL: Enter your custom prompt in the prompt text box.
- Click Create.
- Once the themes are created, click Classify.
- Tick Custom prompt.
- Enter your custom prompt in the prompt text box.
- Click Classify.
Confidence-based classification
Built a prompt to classify responses only when the AI is highly confident that the classification is correct.
Example:
In a survey about soft drink preferences, we will only classify responses where the AI is at least 90% confident in the accuracy of the classification. Leave all other responses unclassified.
Custom Prompt:
The task is to group similar text into the supplied categories. The text has been generated from a survey. The survey asks "Differences in Cola Drinkers: Jan-Feb Only".
Instruction:
- Your primary objective is to accurately classify the text into the appropriate categories based on the responses.
- If the confidence level for classifying a response is below 80%, leave it unclassified.
- For responses with a confidence level between 80% and 89%, also leave them unclassified to avoid errors.
- Only classify text if the confidence level is 90% or higher that the response fits a specific category.
Sentiment analysis
Similar to creating themes based on sentiment, you can also classify responses into themes based on sentiment (positive, negative, neutral).
Example:
In a survey about people’s thoughts about France, classify responses as Positive, Negative, or Neutral.
Custom Prompt:
The task is to group similar text into the supplied categories. The text has been generated from a survey. The survey asks "Thoughts about France".
Text should be classified into the following sentiment categories: Positive, Negative, Neutral. The bot will analyze the tone, context, and content of each text to determine the sentiment.
Use the classification examples below as a reference to group similar text into corresponding sentiment categories:
- Positive → I live in France, I had the best time there!
- Negative → Mean people
- Neutral → N/A
How "Sort by Similarity" makes Sentiment Analysis smarter
When analyzing sentiment in survey responses, the Sort by Similarity feature can be a game-changer. Instead of manually sifting through unclassified responses and verifying every AI-generated classification, the similarity tool groups similar responses together based on their tone and meaning.
For example, when analyzing survey responses about France, you can first classify them into positive, negative, or neutral sentiment categories using AI. The Sort by Similarity algorithm then analyzes the classified responses, identifies similar ones in the unclassified data, and automatically groups them. The length of the orange bar in the Similarity column indicates the quality of the match. The longer the bar, the more similar the response is to the theme. This provides users with two key benefits:
- Faster classification – Unclassified responses are automatically grouped by sentiment, enabling you to sort them much more quickly.
- Improved accuracy – Clustering similar responses makes cross-checking easier, reducing the chances of AI misclassification.
Customize both prompts - theme generation and classification
Use a custom prompt to improve the quality of your text categorizations by providing more context. For example, you can use a custom prompt to make sure the generated themes capture a wider range of opinions, including those with no clear preference or little input. It can also help reduce misclassification when some themes have similar or unclear wording.
Theme Generation
Example:
In a survey with 2,090 responses about choosing a cell phone provider, the non-AI-generated themes might focus mainly on the main topics and overlook responses with no strong preference or minimal input:
However, using a custom prompt when generating themes can fix this by ensuring the AI captures a wider variety of opinions, including those with no strong preference or little input, along with the main topics mentioned in the responses.
Custom Prompt:
The task is to group similar text into meaningful themes. The text has been generated from a survey. The survey asks "Likes".
Ensure the categories comprehensively reflect the diversity and meaningful aspects of all responses, including those that express no clear preference or provide minimal or unclear input.
Response Classification
Example:
In the same survey with 2,090 responses about choosing a cell phone provider, classifying answers into themes with similar wording (like "service," "network service," and "customer service") can lead to misclassification because the AI might get confused for responses that use similar terms but it’s refering to different meaning, which therefore should be classifying into a different themes. For example, someone mentioning "service" might be talking about customer support, while another might mean network quality, leading to mistakes in categorization.
Using a custom prompt can address this misclassification issue by giving the AI clear rules and examples to correctly assign responses to the right category, which improves the classification accuracy.
Custom Prompt:
The task is to group similar text into the supplied categories. The text has been generated from a survey. The survey asks "Likes".
Please follow these guidelines:
- No Preference or Unclear: Only classify responses into this category if the participant explicitly says "Nothing" or uses similar wording (e.g., "I don't know," "Not sure").
- Service: Classify responses into this category when they refer to services in general, such as phrases like "Yes, very good all service," "Strong service," or "It’s great service."
- Network Service: Classify responses into this category when they specifically mention network-related services or use similar wording, such as "Unlimited service and hotspot for one price," "Great Wi-Fi," "Quick speed of mobile data," "Solid network connection."
- Customer Service: Classify responses into this category if they mention interactions with customer support or service representatives, such as "Help from staff," "Customer service was great," or "Assistance was fast."
Ensure that responses are accurately categorized based on the examples provided.