tm4ss - Text Mining for Social Scientists and Digital Humanists

This course consists of 8 tutorials written in R-markdown and further described in this paper.

You can use knitr to create the tutorial sheets as HTML notebooks from the R-markdown source code.

In the /docs folder, you have access to the rendered tutorials.


  1. Web crawling and scraping
  2. Text data import in R
  3. Frequency analysis
  4. Key term extraction
  5. Co-occurrence analysis
  6. Topic models (LDA)
  7. Text classification
  8. Part-of-Speech tagging / Named Entity Recognition

Click here for the rendered tutorials.

Render from source

Clone the repository

git clone

Open the Tutorials.Rproj R-project file and run

rmarkdown::render_site(output_format = "html_document")

License & Citation

This course was created by Gregor Wiedemann and Andreas Niekler. It was freely released under GPLv3 in September 2017. If you use (parts of) it for your own teaching or analysis, please cite

Wiedemann, Gregor; Niekler, Andreas (2017): [Hands-on: a five day text mining course for humanists and social scientists in R]( Proceedings of the 1st Workshop Teaching NLP for Digital Humanities (Teach4DH@GSCL 2017), Berlin.


Download paper


  author    = {Gregor Wiedemann and Andreas Niekler},
  title     = {Hands-On: {A} Five Day Text Mining Course for Humanists and Social Scientists in {R}},
  booktitle = {Proceedings of the Workshop on Teaching {NLP} for Digital Humanities
               ({Teach4DH@GSCL 2017}), Berlin, Germany, September 12, 2017.},
  pages     = {57--65},
  year      = {2017},
  crossref  = {DBLP:conf/gldv/2017teach4dh},
  url       = {},