An interactive Shiny app for AI-assisted coding of open-ended survey responses.
forage is an interactive Shiny application for coding open-ended survey responses into structured qualitative themes using OpenAI’s language models.
It is designed for survey researchers and analysts who want a faster, more consistent, and more transparent way to generate code frames and apply them to large volumes of verbatim responses without losing human control over the process.
The workflow is explicitly human-in-the-loop: generated theme lists can be reviewed, edited, or replaced before coding begins.
forage is deployed on shinyapps.io. Use it at https://giobuzala.shinyapps.io/forage/. Best experienced on desktop or tablet.
-
Upload a survey Excel file (
.xlsxor.xls) that contains:- a respondent ID column
- an open-ended response column
-
Theme generation creates a theme list:
- Code - a unique numeric code for each theme (e.g., 1, 2, 3)
- Bin - short descriptive label for the theme (e.g., "Trust", "Price", "Service")
- Description - a brief explanation of what the theme represents
-
Coding responses assigns all applicable codes from the theme list to each response. The output is an Excel file with two sheets:
Coded ResponsesTheme List
This structure keeps the coding transparent and auditable, making it easy to review results, share with collaborators, or feed into downstream analysis workflows.
This tool uses AI to assist with generating themes and coding open-ended survey responses. The resulting themes and codes are based on probabilistic interpretations of text and may differ from how a human researcher would code the same responses.
As a best practice, generated themes should be reviewed before coding, with results validated against research objectives and human judgment applied where nuance or ambiguity exists.
This tool is designed to accelerate qualitative analysis, not to replace expert review or methodological oversight.
AI processing is performed only to generate requested outputs. OpenAI does not train its models on data submitted through the API. Data is handled in accordance with OpenAI's API data-usage policies and is not used for advertising, profiling, or model improvement.
Users are responsible for ensuring that their use of AI tools complies with applicable data-handling, privacy, and confidentiality requirements.
Learn more at Business data and Your data.
app.RShiny UI with two steps: generate themes, then code responses.Functions/theme_gpt.RGenerates a theme list from open-ended responses.Functions/code_gpt.RCodes responses using a provided theme list.
- Install packages:
install.packages(c(
"dotenv", "dplyr", "httr2", "openxlsx", "purrr", "readxl", "shiny", "shinyjs", "stringr"
))- Set your OpenAI API key using one of the following methods:
Sys.setenv(OPENAI_API_KEY="your_api_key")Or create a local .Renviron file in the project root:
OPENAI_API_KEY="your_api_key"- Start the app:
shiny::runApp("app.R")This project is released under a custom non-commercial license authored by the project owner.