Text Classification with LLMs

Description

In this course, you will learn the basics of using a large language model (specifically, ChatGPT) for text classification. Using the ChatGPT application programming interface (API), we will explore how LLMs can assist humans (and humanists) with various text classification tasks (e.g., binary, labeling, applying confidence intervals to judgments, etc.). We will get to know the API, create validation data, engineer prompts, and automate API calls for large data sets.

Course Content

Each numbered notebook corresponds with one 90-minute class session.

Sessions presume that participants are already familiar with Python, Jupyter Notebooks, and pandas.

Lesson 1

Why classify texts?

Technical introduction

API Costs

Lesson 2

Review Lesson 1

Texts to classify

Overview of text classification types

Evaluating LLM classifications

Quantifying model uncertainty

Lesson 3

Prompt engineering

Systematically testing classification prompts

What can we do with classifications once we have them?