Displayr incorporates advances in AI technology into our software to make it easier for you to analyze your data. These methods are built off of OpenAI technology to provide new and improved features in the software.
This article will walk you through different options that are available in Displayr. For more in-depth information and examples see Using OpenAI in Displayr.
- Built-in Displayr AI vs OpenAI Connection
- Tidy Your Labels
- Text Analytics
- Using AI Prompts to Create Outputs
- AI-generated Custom Variables
- Help with Code
Built-in Displayr AI vs OpenAI Connection
There are a couple of different ways that you can utilize AI in Displayr:
Displayr AI
Our homegrown AI tool is powered by OpenAI in the background. It can be used to tidy labels and to assist in text categorization. You will need to enable Displayr AI to make use of these features. See Displayr AI for instructions on how to opt-in.
Connect your OpenAI account
This allows you to create AI-generated outputs using prompts and inputs directly from your data. You will need to connect your OpenAI account to Displayr. See Connecting Displayr to OpenAI for instructions and requirements.
Tidy Your Labels
Displayr AI allows you to tidy your variable labels upon import or when combining variables. See Better Variable Labeling on Import and Better Variable Set Labeling on Combine.
Text Analytics
Text Categorization
If you're looking for an AI-assist when it comes to classifying your text data, but still want some flexibility to refine and edit with a human eye, you can use Displayr AI text categorization. The built-in categorization tool allows you to utilize AI to help create themes and classify your text data while enabling you to create and modify themes and edit and refine the classification. For details on how to do this, go to How to Classify Text Data.
If you instead want to leave text categorization completely in AI's hands, select the text variable in the Data Sources tree, hover, and click + > Custom Code AI > Text. From there, enter a Prompt, click Calculate, and let AI do the rest.
In the example below, I have a text variable "Q6" that contains reasons why respondents would or would not purchase a new burger concept. I used + > Custom Code AI > Text and prompted it to create 10 themes based on the text responses. The AI-generated themes are shown in the right column (ai_custom_variable):
You can use the Prompt for more specific theme creation. For best results, your prompts need to be clear, specific, and concise, providing context when necessary.
Translation
You can use AI to translate your text data. This method will create a new text variable containing the translated text, which you can use for text categorization. Select the text variable in the Data Sources tree that needs translation, then hover and click + > Text Manipulation > Translate. From there, you can refine the default Prompt as needed and specify the Source language. The Source language dropdown includes options to auto-detect the input language and to specify using a variable if you have an existing variable with a list of languages in your data set.
Identify Poor Text Data
Oftentimes, raw text data contains non-sensical responses, contain expletives, or are, in general, "garbage". You can identify good vs bad responses in your text variables by hovering over the variable in the Data Sources tree, clicking + > Data Quality > Poor Text Data, and then entering a Prompt. For example:
A new variable will be created, which you can use as a filter variable and edit the raw data or remove cases, if necessary.
Sentiment Analysis
To take your text analysis a step further, you can assign numeric values to the text responses using AI to determine sentiment using + > Numeric Transformations > Sentiment from the Data Sources tree. For example, I can take the translated hotel reviews from above and prompt AI to assign a value of 1 to positive reviews and -1 to negative reviews:
Using AI Prompts to Create Outputs
Using your connected OpenAI account, you can use various functions available from the AI button in the toolbar. They include outputs for:
- Custom AI Calculation - lets you pass a specific prompt and relevant variables and outputs from your Report to ChatGPT. Read more about this feature here.
- AI Generated Image - will generate an image using the Dall-E model based on the Prompt entered on the Data tab in the object inspector. Read more about this feature here.
- Summarize - allows you to feed various items to the output for interpretation via fields in the object inspector > Data tab. There is default text in the Prompt so no need to come up with your own prompt unless you'd like to tweak what the output returns. Read more about this feature here.
You can read more details for each and see examples in Using OpenAI in Displayr. See Getting Started with OpenAI Prompting in Displayr for tips to help improve your prompts when using the OpenAI features.
AI-generated Custom Variables
If you want to create new custom variables, AI can help. In the Data Sources tree, the Plus + > Custom Code > AI menu creates different types of variables based on a Prompt and Input Variables. The default behavior will do a complete case analysis of the variables selected and will flag cases with complete data. Flags are coded based on the type of variable you want to create:
- Date: Constructs a Date/Time variable that takes today’s date if the data is complete and is a missing value if there is incomplete data.
- Numeric: Constructs a Numeric variable which takes the value of 1 of the data is complete and 0 if the data has any missing values. You can click Usable as filter to be able to filter in complete cases on outputs and analyses.
- Nominal: Constructs a Nominal variable that takes the label 'Complete' if the data is complete and 'Incomplete' if the data has any missing values.
- Ordinal: Same as 'Nominal' but creates an Ordinal variable.
- Text: Same as 'Nominal' but creates a Text variable. See Text Categorization above for an example.
You can also customize the Prompt via the object inspector to have the AI perform different actions such as converting numbers stored as a Text variable into an actual Numeric variable or identifying mentions of proper names (e.g., brands) in text, and then creating a new text variable that has only that information in it.
Help with Code
Before getting the AI to help write code, you should review the programming section of our writing prompts article. The features used to help you with programming in Displayr are:
- R Code - can help you generate code in the R language. It's useful for creating or checking code for calculations, calculation grids, and R variables. As discussed in Getting Started with OpenAI Prompting in Displayr, our R function libraries have not been specifically used to train the AI, thus it's recommended to search the Help Center for specific custom coding tasks such as creating formatted tables with our CreateCustomTable() function. See AI R Code Writer for examples and tips.