How to Build an NLP Pipeline in Python to Analyze Therapy Progress Notes
Therapy progress notes are written records of what happened during a therapy session—what the client said, what the therapist observed, the topics discussed, and plans for the next session. Over time, these notes can accumulate into a substantial volume of text.
Reading a single note helps us understand one session. But what if we want to examine several notes together? Can text analysis reveal how language shifts from one session to the next?
Natural Language Processing (NLP) uses computers to work with human language. With Python, you can split text into sentences, extract language features, and apply models to classify sentiment and emotion. In this tutorial, you'll use spaCy's language-processing pipeline for text processing and Hugging Face Transformers to run pretrained classification models.
You'll build a small NLP pipeline using fictional therapy notes. You'll use spaCy to process the text, two ready-made Hugging Face models to classify sentiment and emotion, pandas to organize results by session, and Matplotlib to create charts.
The complete project code is available in the GitHub repository.
The goal is not to determine whether therapy is working. Rather, we aim to learn how to turn written text into data that we can review, question, and display in charts.
By the end, you'll have a practical Python project using spaCy, Hugging Face Transformers, pandas, and Matplotlib to explore sentiment, emotion, and language patterns in fictional therapy notes.
Note: This tutorial is for learning purposes only and uses fictional text. The models have not been tested for clinical use. They cannot determine whether therapy is working, identify problems in the therapist-client relationship, or replace a trained professional.
Table of Contents
(Coming from source: full list of sections)
Last updated: November 17, 2026
via FreeCodeCamp
