/text-as-data

Materials for the Spring 2021 MIT Political Methodology Lab "Introduction to Text Analysis" Workshop

MIT LicenseMIT

Introduction to Text Analysis

MIT PML Workshops Spring 2021

Materials for the Spring 2021 MIT Political Methodology Lab "Introduction to Text Analysis" Workshop, taught by Andy Halterman and Aidan Milliff.

Contents

  • text_analysis.Rmd: Code (and explanation) for the text analysis demos. We cover 1) sentiment analysis using sentiment dictionaries and tidytext, 2) topic modeling with stm, and 3) regularized logit classification with glmnet.
  • stm.RData: Loads a fitted STM model to save us time (and keep results consistent) during the workshop.
  • Workshop_Text_Pres.pdf: The slides!

Notably missing: train.csv, the data we use in the demos. Register here to get that file via email.