Text Classification with LLMs#
Text classification — automatically assigning categories or labels to texts — is one of the most common tasks in cultural analytics. LLMs offer powerful new approaches to classification, from zero-shot prompting (no training data required) to fine-tuning models on your own labeled data.
Zero-Shot Prompting with LLMs#
This tutorial demonstrates how to set up zero-shot classification tasks, where the model classifies texts without any prior training examples. It covers prompting strategies for book genre classification and narrative classification, and shows how to evaluate the results.
Training and Fine-Tuning BERT for Classification#
This tutorial walks through training and fine-tuning a BERT model to classify Goodreads reviews by book genre. Fine-tuning allows you to adapt a pre-trained model to your specific research task, often achieving strong results with relatively small amounts of labeled data.
From AI for Humanists