Using Howdy Coder for Research

In this example a researcher uses Howdy Coder to apply sentiment analysis on her dataset to determine gender bias.

Sentiment Analyis Example

In this example we create an algo with a data source and an event. Above is a video example of this and below is a text walkthrough of the example. The algo we are creating can be diagrammed as such:

Data Source (CSV File) -> Event (Chat GPT Sentiment Analysis)

Data Source (CSV File)

Here the data source has a type of function and we ask the AI to create a function that reads a csv file. The example file has data like:

Description Gender
Student did not remember to ask for my DOB and was late. M
Student's dress was too short and was not professional. F

Settings

With the data organized as such we tell the AI that the first row of the data in the csv (excel file) will serve as the header or the keys of the data. The AI understands that it has to identify each of its groups of data by some identifier called a key. So thats why we tell it the first row contains the keys. If you have an API Key set, then you can use the window as in the example. If not, you can copy the prompt (Data Source) from the prompt page and then the query for the code into your choice of LLM that handles creating code well.

After we've created the function, we then have to assign the data source output, which are the keys we just mentioned, in the table below. We use the "+" button at the bottom to add our rows and rename the items to "Description" and "Gender". We do this because at this point, we haven't read the file in and we need to tell Howdy Coder what data we have so we can act on it later.

Sometimes Howdy Coder will be able to give you suggestions from the AI on what output to put, other times where we're reading in our own, potentially dynamic data, we have to assign the keys ourselves.

Parameters

After the settings page, we have the parameters page, here we make two changes:

  1. Check single shot. We only want this function to run once. The data won't be changing as it is just a csv file and so we don't need the analysis run more than once.
  2. Add the csv file path to the parameter table. Use the add button to add an item to the table. Change the name to match the suggestion. Change the type to file. Use the select button and the subsequent file dialog to select the csv file we are processing.

After that we are done with the data source and our settings for reading in the data. We will now proceed to the event for the analysis.

Event (Chat GPT Sentiment Analysis)

Now that we have all our data, we add an action of type event. We choose event because we want to produce more data, rather than performing an output. The data we are producing is the sentiment analysis.

Settings

Just like the data source, our first step with the event settings is creating the calculation function. Using the same window, we ask the AI to create a function that passes a system prompt and api key from parameters and a user prompt from data set to chat gpt. Here the AI understnads parameters and data set. Parameters we set on the next page and data set we set on the bottom of the event settings page.

The user prompt that we are taking from the data set is the description we read in from the csv file. We select the description in the available input table and then in the selected input table, we rename it to match the data set suggestions. We don't have to make any other changes here as the defaults are fine. After that we're done with the event settings and just have the parameters.

Parameters

This time we have two parameters to add, api key and system prompt. Both of these are strings and we add them to the table just as before and select type of string. The system prompt, we already have ready and we paste this in to the value field:

"You are to do sentiment analysis on a professors description of a simulated interaction between a patient and student. The professor wrote down what they noticed about the student during the interaction. You are to only reply Positive or Negative, based on what you perceive to be the sentiment of the professor about the student and their performance. Do not reply anything other than a single word, Positive or Negative."

The api key we got from openai.com on our account. We also use this same api key for the in-app code generation.

Once both those parameters are done, we finish up the event and then the whole algo. We're done with the creator at this point.

Wrapping Up

Now that we're finished building, we can run the algo back on the control page. After hitting start and letting the data be fully processed we can export it. In the exported data we have the data we initially read in along with our third column of data with sentiment analysis. Complete!