Book

In progress

Python Programming for Social Workers
A Hands-On Guide to Natural Language Processing and Large Language Models in Research and Practice
Nari Yoo. Routledge, forthcoming.

Social workers work extensively with text data, and interest in large language models (LLMs) has created demand for computational text analysis skills that most social work programs do not yet teach. This hands-on textbook teaches social work students, researchers, and practitioners to write Python code that applies natural language processing (NLP) and LLM methods in research and in the AI workflows that agencies are adopting.

Written for readers with no programming background, the book is organized around the division between pre-LLM and LLM methods, so that readers learn when a dictionary, a classical classifier, an encoder model, a small open-weight model run locally, or a commercial LLM fits a task. Each chapter is built on a Google Colab notebook with worked code and exercises on social work text. Privacy, data rights, and security are covered with professional ethics before any method is taught, with the NASW Code of Ethics as the primary reference alongside guidance from other countries, and each LLM chapter opens with the ethical questions its methods raise.

Designed for MSW and PhD courses, the book teaches enough Python for readers to direct coding agents such as Claude Code and Codex, check their output, and take responsibility for the result.

Contents

Part I. Foundations
1Social Work Records as Data in the Age of AI
2Python Basics with Case Notes and Social Work Text
3Collecting and Cleaning Social Work Text Data
Part II. Ethics and Pre-LLM NLP Methods
4Ethics, Privacy, and Data Security in Social Work AI
5Topic Modeling, Sentiment Analysis, and Classic NLP
6Model Evaluation, Fairness, and Explainable AI
Part III. Large Language Models
7Inside Large Language Models and Transformers
8Prompt Engineering, APIs, and Choosing a Method
9Connecting LLMs to Documents with RAG and Tool Use
Part IV. Applications and Tool Building
10LLM Applications for Social Work Practice and Research
11Building Social Work Tools with AI Coding Agents
Part V. Capstone
12Evaluating, Deploying, and Maintaining an AI Project

Companion materials

Open-access companion materials will accompany the book: a GitHub repository with the code and sample datasets (synthetic case notes and public policy documents), a Colab notebook for each chapter, and password-protected instructor resources (syllabi, coding assignments with solution notebooks, rubrics, and a test bank).