Code Example: Automated Five Factor Assessment Responses Using ChatGPT

Published on: February 6, 2024

Purpose

This page provides a working example of a Python script that repeatedly prompts the ChatGPT LLM to consider five factor assessment questions and provide a standard likert response with justification. The prompts and responses are saved as a comma-separated value (CSV) file.


A Cautionary Note on Generative AI

Generative Artificial Intelligence (AI) tools are capable of rapidly responding to user-provided prompts and returning responses informed from a large language model (LLM). The quality of the responses and relevance to the prompt is highly dependent on quality of the LLMs. As of the time of this writing, particular caution should be used when using even the most advanced LLMs for research purposes as the responses have been found to provide false information and include biased perspective.


Code Example

Prerequisites: This code queries the ChatGPT-4 LLM and requires use of the User's ChatGPT API key. You can find instructions on how to procure your own key here.

Python script: collecting GenAI responses for a 5 factor assessment