Python Text Analysis: Parts 1-3

March 17, 2025, 2:00pm to March 31, 2025, 4:00pm

REGISTRATION NOTES

Click register and then use your @berkeley.edu or @lbl.gov email address.
If you have trouble, you may need to log out of Zoom and log back in.
For help read more here: https://dlab.berkeley.edu/zoom-troubleshooting-tips

Register

Location: Remote via Zoom. Link will be sent on the morning of the event.

Recordings: This D-Lab workshop will be recorded and made available to UC Berkeley participants for a limited time. Your registration for the event indicates your consent to having any images, comments and chat messages included as part of the video recording materials that are made available.

Start Time: D-Lab workshops start 10 minutes after the scheduled start time (“Berkeley Time”). We will admit all participants from the waiting room at that time.

Date & Time: This workshop is a 3-part series running from 2pm-4pm each day:

  • Part 1: Mon, March 17
  • Part 2: Wed, March 19
  • Part 3: Mon, March 31

Description

This three-part workshop will prepare participants to move forward with research that uses text analysis, with a special focus on social science applications. We explore fundamental approaches to applying computational methods to text in Python. We cover some of the major packages used in natural language processing, including scikit-learn, NLTK, spaCy, and Gensim.

  • Part 1: Preprocessing. How do we standardize and clean text documents? Text data is noisy, and we often need to develop a pipeline in order to standardize the data to better facilitate computational modeling. You will learn common and task-specific operations of preprocessing, becoming familiar with commonly used NLP packages and what they are capable of. You will also learn about tokenizers, and how they have changed since the advent of Large Language Models.
  • Part 2: Bag-of-words. In order to do any computational analysis on the text data, we need to devise approaches to convert text into a numeric representation. You will learn how to convert text data to a frequency matrix, and how TF-IDF complements the Bag-of-Words representation. You will also learn about parameter settings of a vectorizer and apply sentiment classification to vectorized text data.
  • Part 3: Word Embeddings. Word Embeddings underpin nearly all modern language models. In this workshop, you will learn the differences between a bag-of-words representation and word embeddings. You will be introduced to calculating cosine similarity between words, and learn how word embeddings can suffer from biases.

The materials for this workshop series are designed to build on each other. Part 2 assumes familiarity with the content from Part 1, and Part 3 similarly requires understanding of both preceding parts.

Prerequisites: We recommend attending Python Fundamentals, Python Data Wrangling, and Python Machine Learning Fundamentals prior to this workshop.

Workshop Materials: https://github.com/dlab-berkeley/Python-Text-Analysis

Software Requirements: Installation Instructions for Python Anaconda

Is Python not working on your laptop? Attend the workshop anyway, we can provide you with a cloud-based solution until you figure out the problems with your local installation.

Questions? Email: dlab-frontdesk@berkeley.edu