LLMs and AI for Cultural Analytics#

This section introduces Large Language Models (LLMs) and AI tools for humanities and social science research. The tutorials below are drawn from AI for Humanists, a project created by Melanie Walsh, David Mimno, and Matt Wilkens and designed to help humanities researchers and students understand, use, and critically engage with AI technologies.

What LLM Should I Use?#

See the AI for Humanists Guide to Models for help choosing the right model for your research task.

Tutorials#

The following tutorials are available as Google Colab notebooks, which means you can open and run them directly in your browser without any installation.

Local LLMs#

Working with Local LLMs (On Your Own Computer!) — Ollama and Llama 3 Run LLMs locally so your data never leaves your machine. Covers setting up Ollama, creating structured data from unstructured text, chatting with a local LLM, and generating document embeddings. 🚀 Open in Colab

Word and Document Embeddings#

Measuring Document Similarity with LLMs Use LLMs to find similar texts within a dataset, including comparing narrative versus non-narrative texts and analyzing poetry collections. 🚀 Open in Colab

Measuring Word Similarity with BERT Use a pre-trained BERT model to measure word similarity by finding semantically comparable words from poem collections. 🚀 Open in Colab

Measuring Word Similarity with BERT (Spanish) A demo showing how the word similarity approach works with a Spanish-language BERT model, illustrating that these techniques can be applied beyond English. 🚀 Open in Colab

Text Classification#

Zero-Shot Prompting with LLMs Classify texts without any training examples. Covers prompting strategies for book genre and narrative classification, and how to evaluate results. 🚀 Open in Colab

Training and Fine-Tuning BERT for Classification Train and fine-tune a BERT model to classify Goodreads reviews by book genre. 🚀 Open in Colab

Workshop Slides#

The AI for Humanists team has also given a number of workshops on LLMs and AI for humanities researchers. Slides from past workshops are available on the AI for Humanists Workshops page. A few highlights: