Big Data Analytics (first term 2021/22)
Overview of the course
IMPORTANT INFO
The first 4 classes (2 weeks) of the course will be held on-line. Since the 7 of October, the course will be held in Via Pace in a mixed method (in class/online). The Zoom URL to get access to the course is the following one: https://zoom.us/j/5469311951.
To register your final mark for this course, plz enroll yourself at the Big Data Analytics exam of 16 December 2021
Course aims and objectives
Students will learn how to employ some widely discussed methods advanced in the literature to analyze political texts and to extract from them useful information for texting their own theories.
First Lecture
23/09/21, 10:00-12:00 Theory: An introduction to text analytics
Reference texts: (1; 2, 3)
23/09/21, 10:00-12:00 Lab class: An introduction to the Quanteda package (a) packages to install; b) Lab 1 slides; scripts: Lab 1 script; datasets: a) Boston tweets sample; b) Inaugural US Presidential speeches sample (to open this file, please use the data compression tool WinRAR)
First assignment (due: 29 September 2021)
Second Lecture
30/9/21, 10:00-12:00 Theory: From words to positions: unsupervised scaling models
Reference texts (1; 2; 3)
1/10/21, 10:00-12:00 Lab class: How to implement the Wordfish algorithm (scripts: a) packages to install; b) Lab 2 script (part I: Wordifsh); c) Lab 2 Script (part II: playing with Twitter); d) Lab 2 script (EXTRA: Tokenize Japanese and Chinese texts); e) Lab 2 script (EXTRA: estimating bootstrap confidence intervals in Wordfish); f) Lab 2 script (EXTRA: estimating Wordshoal); dataset: a) sample of Japanese legislatives speeches (to open these files, please use the data compression tool WinRAR); b) UK party programs 1992 and 1997 (to open this file, please use the data compression tool WinRAR)
Second assignment (due: 6 October 2021) (dataset for Assignment 2. To open this file, please use the data compression tool WinRAR)
Third Lecture
7/10/21, 10:00-12:00 Theory: From words to positions: Supervised scaling models
Reference texts (1; 2; 3)
8/10/21, 10:00-12:00 Lab class: How to implement the Wordscores algorithm (a) Lab 3 slides; b) Lab 3 script (part I: Wordscores); c) Lab 3 script (part II: geography and Twitter); d) dataset for the second part of the Lab)
Third assignment (due: 13 October 2021)
Fourth Lecture
14/10/21, 10:00-12:00 Theory: From words to issues: unsupervised classification models
Reference text (1):
15/10/21, 10:00-12:00 Lab class: How to implement a Topic Model (scripts: a) packages to install; b) Lab 4 script (topic model); c) Lab 4 script (EXTRA: estimating a cluster analysis); datasets: Guardian 2016; Guardian 2013).
Fourth assignment (due: 20 October 2021)
Fifth Lecture
21/10/21, 10:00-12:00 Theory: (Part 1): From words to issues: structural topic models; (Part 2): Dictionary models
Reference texts (1, 2):
22/10/21, 10:00-12:00 Lab class: How to implement a Structural Topic Model and dictionary models (scripts: a) packages to install; b) Lab 5 script: STM; c) Lab 5 dictionaries; d) Lab 5 dictionaries and Twitter; dataset: a) NyT; b) data for topical content analysis)
Fifth Assignment (due: 27 October 2021)
Sixth Lecture
28/10/21, 10:00-12:00 Theory: (Part 1): From words to issues: semi-supervised classification models; (Part 2): An introduction to supervised classification models
Reference texts (1, 2, 3, 4):
29/10/21, 10:00-12:00 Lab class: How to implement a semi-supervised classification model (scripts: a) packages to install; b) Lab 6 script: Newsmap; c) Lab 6 script: KeyATM)
Sixth Assignment (due: 3 November 2021)
Seventh Lecture
4/11/21, 10:00-12:00 Theory: From words to issues: supervised classification models
Reference text (1):
5/11/21, 10:00-12:00 Lab class: How to implement supervised classification models (scripts: a) packages to install; b) Lab 7 Lab slide; c) Lab 7 script; datasets: a) disasters training-set; b) disasters test-set; c) Nationality)
Seventh Assignment (due: 10 November 2021) (datasets for Assignment 7: a) UK training set; b) UK test set)
Eigth Lecture
11/11/21, 10:00-12:00 Theory: How to validate the results you get from machine learning algorithms
Reference text (1, 2, 3):
12/11/21, 10:00-12:00 Lab class: How to apply k-fold cross validation (scripts: a) package to install; b) Lab 8 script (part A); c) Lab 8 script (part B); d) Lab 8 script (part C); e) training-set for the lab; f) secondo training-set for the lab
Eigth Assignment (due: 17 November 2021)
Ninth Lecture
18/11/21, 10:00-12:00 Theory: (Part 1): Some further algorithms for ML; (Part 2): The importance of the training set
Reference texts (1; 2):
Ninth Assignment (due: 24 November 2021)
Tenth Lecture
25/11/21, 11:00-13:00 Theory: An introduction to word embeddings
Reference texts (1, 2):
26/11/21, 11:00-13:00 Lab class: How to implement a proportional algorithm and a word-embedding procedure. (scripts: a) packages to install; b) Lab 10 script; dataset for the lab: training-set; test-set; pre-trained WE)
Tenth Assignment (due: 1 December 2021)
The first 4 classes (2 weeks) of the course will be held on-line. Since the 7 of October, the course will be held in Via Pace in a mixed method (in class/online). The Zoom URL to get access to the course is the following one: https://zoom.us/j/5469311951.
To register your final mark for this course, plz enroll yourself at the Big Data Analytics exam of 16 December 2021
Course aims and objectives
Students will learn how to employ some widely discussed methods advanced in the literature to analyze political texts and to extract from them useful information for texting their own theories.
First Lecture
23/09/21, 10:00-12:00 Theory: An introduction to text analytics
Reference texts: (1; 2, 3)
- Grimmer, Justin, and Stewart, Brandon M. 2013. Text as Data: The Promise and Pitfalls of Automatic Content Analysis Methods for Political Texts. Political Analysis, 21(3): 267-297
- Benoit, Kenneth (2020). Text as data: An overview. In Luigi Curini and Robert Franzese (eds.), SAGE Handbook of Research Methods is Political Science & International Relations, London, Sage, chapter 26
- Grossman, Jonathan, and Pedahzur Ami (2020). Political Science and Big Data: Structured Data, Unstructured Data, and How to Use Them, Political Science Quarterly, 135(2): 225-257
23/09/21, 10:00-12:00 Lab class: An introduction to the Quanteda package (a) packages to install; b) Lab 1 slides; scripts: Lab 1 script; datasets: a) Boston tweets sample; b) Inaugural US Presidential speeches sample (to open this file, please use the data compression tool WinRAR)
First assignment (due: 29 September 2021)
Second Lecture
30/9/21, 10:00-12:00 Theory: From words to positions: unsupervised scaling models
Reference texts (1; 2; 3)
- Proksch, Sven-Oliver, and Slapin, Jonathan B. 2008. A Scaling Model for Estimating Time-Series Party Positions from Texts. American Journal of Political Science, 52(3): 705-722.
- Proksch, Sven-Oliver, and Slapin, Jonathan B. 2009. How to Avoid Pitfalls in Statistical Analysis of Political Texts: The Case of Germany. German Politics, 18(3): 323-344.
- Curini, Luigi, Hino, Airo, and Atsushi Osaki. 2020. Intensity of government–opposition divide as measured through legislative speeches and what we can learn from it. Analyses of Japanese parliamentary debates, 1953–2013, Government and Opposition, 55(2), 184-201
1/10/21, 10:00-12:00 Lab class: How to implement the Wordfish algorithm (scripts: a) packages to install; b) Lab 2 script (part I: Wordifsh); c) Lab 2 Script (part II: playing with Twitter); d) Lab 2 script (EXTRA: Tokenize Japanese and Chinese texts); e) Lab 2 script (EXTRA: estimating bootstrap confidence intervals in Wordfish); f) Lab 2 script (EXTRA: estimating Wordshoal); dataset: a) sample of Japanese legislatives speeches (to open these files, please use the data compression tool WinRAR); b) UK party programs 1992 and 1997 (to open this file, please use the data compression tool WinRAR)
Second assignment (due: 6 October 2021) (dataset for Assignment 2. To open this file, please use the data compression tool WinRAR)
Third Lecture
7/10/21, 10:00-12:00 Theory: From words to positions: Supervised scaling models
Reference texts (1; 2; 3)
- Laver, Michael, Kenneth Benoit, John Garry. 2003. Extracting Policy Positions from political texts using words as data. American Political Science Review, 97(02), 311-331
- Egerod, Benjamin C.K., and Robert Klemmensen (2020). Scaling Political Positions from text. Assumptions, Methods and Pitfalls. In Luigi Curini and Robert Franzese (eds.), SAGE Handbook of Research Methods is Political Science & International Relations, London, Sage, chapter 27
- Martin, Lanny W., and Georg Vanberg. 2008. A robust transformation procedure for interpreting political text. Political Analysis, 16: 93-100
8/10/21, 10:00-12:00 Lab class: How to implement the Wordscores algorithm (a) Lab 3 slides; b) Lab 3 script (part I: Wordscores); c) Lab 3 script (part II: geography and Twitter); d) dataset for the second part of the Lab)
Third assignment (due: 13 October 2021)
Fourth Lecture
14/10/21, 10:00-12:00 Theory: From words to issues: unsupervised classification models
Reference text (1):
- Robert, Margaret E., Brandon M. Stewart, Dustin Tingley, Christopher Luca, Jetson Leder-Luis, Shana Kushner Gadarian, Bethany Albertson, David G. Rand. 2014. Structural Topic Models for Open-Ended Survey Response. American Journal of Political Science, 58(4), 1064-1082
15/10/21, 10:00-12:00 Lab class: How to implement a Topic Model (scripts: a) packages to install; b) Lab 4 script (topic model); c) Lab 4 script (EXTRA: estimating a cluster analysis); datasets: Guardian 2016; Guardian 2013).
Fourth assignment (due: 20 October 2021)
Fifth Lecture
21/10/21, 10:00-12:00 Theory: (Part 1): From words to issues: structural topic models; (Part 2): Dictionary models
Reference texts (1, 2):
- Roberts, Margaret E., Brandon M. Stewart, Dustin Tingley. 2014. STM: R Package for Structural Topic Models. Journal of Statistical Software, https://cran.r-project.org/web/packages/stm/vignettes/stmVignette.pdf
- Grimmer, Justin, and Stewart, Brandon M. 2013. Text as Data: The Promise and Pitfalls of Automatic Content Analysis Methods for Political Texts. Political Analysis, 21(3): 267-297
22/10/21, 10:00-12:00 Lab class: How to implement a Structural Topic Model and dictionary models (scripts: a) packages to install; b) Lab 5 script: STM; c) Lab 5 dictionaries; d) Lab 5 dictionaries and Twitter; dataset: a) NyT; b) data for topical content analysis)
Fifth Assignment (due: 27 October 2021)
Sixth Lecture
28/10/21, 10:00-12:00 Theory: (Part 1): From words to issues: semi-supervised classification models; (Part 2): An introduction to supervised classification models
Reference texts (1, 2, 3, 4):
- Kohei Watanabe and Yuan Zhou (2020) Theory-Driven Analysis of Large Corpora: Semisupervised Topic Classification of the UN Speeches. Social Science Computer Review, DOI: 10.1177/0894439320907027
- Shusei Eshima, Kosuke Imai, and Tomoya Sasaki (2020). Keyword Assisted Topic Models, arXiv:2004.05964v1
- Grimmer, Justin, and Stewart, Brandon M. 2013. Text as Data: The Promise and Pitfalls of Automatic Content Analysis Methods for Political Texts. Political Analysis, 21(3): 267-297
- Curini, Luigi, and Robert Fahey. 2020. Sentiment Analysis. In: Luigi Curini and Robert Franzese (eds.), Sage Handbook of Research Methods in Political Science and International Relations, London: Sage, chapter 29
29/10/21, 10:00-12:00 Lab class: How to implement a semi-supervised classification model (scripts: a) packages to install; b) Lab 6 script: Newsmap; c) Lab 6 script: KeyATM)
Sixth Assignment (due: 3 November 2021)
Seventh Lecture
4/11/21, 10:00-12:00 Theory: From words to issues: supervised classification models
Reference text (1):
- Olivella, Santiago, and Shoub Kelsey (2020). Machine Learning in Political Science: Supervised Learning Models. In Luigi Curini and Robert Franzese (eds.), SAGE Handbook of Research Methods is Political Science & International Relations, London, Sage, chapter 56
5/11/21, 10:00-12:00 Lab class: How to implement supervised classification models (scripts: a) packages to install; b) Lab 7 Lab slide; c) Lab 7 script; datasets: a) disasters training-set; b) disasters test-set; c) Nationality)
Seventh Assignment (due: 10 November 2021) (datasets for Assignment 7: a) UK training set; b) UK test set)
Eigth Lecture
11/11/21, 10:00-12:00 Theory: How to validate the results you get from machine learning algorithms
Reference text (1, 2, 3):
- Grimmer, Justin, and Stewart, Brandon M. 2013. Text as Data: The Promise and Pitfalls of Automatic Content Analysis Methods for Political Texts. Political Analysis, 21(3): 267-297
- Cranmer, Skyler J. and Desmarais, Bruce A. (2017) What Can We Learn from Predictive Modeling?, Political Analysis, 25: 145-166
- Curini, Luigi, and Robert Fahey. 2020. Sentiment Analysis. In: Luigi Curini and Robert Franzese (eds.), Sage Handbook of Research Methods in Political Science and International Relations, London: Sage, chapter 29
12/11/21, 10:00-12:00 Lab class: How to apply k-fold cross validation (scripts: a) package to install; b) Lab 8 script (part A); c) Lab 8 script (part B); d) Lab 8 script (part C); e) training-set for the lab; f) secondo training-set for the lab
Eigth Assignment (due: 17 November 2021)
Ninth Lecture
18/11/21, 10:00-12:00 Theory: (Part 1): Some further algorithms for ML; (Part 2): The importance of the training set
Reference texts (1; 2):
- Olivella, Santiago, and Shoub Kelsey (2020). Machine Learning in Political Science: Supervised Learning Models. In Luigi Curini and Robert Franzese (eds.), SAGE Handbook of Research Methods is Political Science & International Relations, London, Sage, chapter 56
- Barberá, Pablo et al. (2020). Automated Text Classification of News Articles: A Practical Guide. Political Analysis, DOI: 10.1017/pan.2020
Ninth Assignment (due: 24 November 2021)
Tenth Lecture
25/11/21, 11:00-13:00 Theory: An introduction to word embeddings
Reference texts (1, 2):
- Rodriguez Pedro L. and Spirling Arthur (2021). Word Embeddings: What works, what doesn’t, and how to tell the difference for applied research, Journal of Politics, forthcoming
- Rudkowsky Elena, et al. (2018). More than Bags of Words: Sentiment Analysis with Word Embeddings. Communication Methods and Measures. 12:2-3, 140-157
26/11/21, 11:00-13:00 Lab class: How to implement a proportional algorithm and a word-embedding procedure. (scripts: a) packages to install; b) Lab 10 script; dataset for the lab: training-set; test-set; pre-trained WE)
Tenth Assignment (due: 1 December 2021)