Code Monkey home page Code Monkey logo

tm_bundestag's Introduction

A topic model for the debates of the 18th German Bundestag as a showcase example

Markus Konrad [email protected], May 2018

Important note: If you want to git clone this project, you need to install git lfs first.

Overview

For a workshop on practical topic modeling, I created this topic model as a showcase example that demostrates the steps that are necessary to take in order to arrive at a usable, informative model:

  1. Preprocessing the raw data (preproc_raw.py)
  2. Generating the document-term-matrix from the data (generate_tokens.py)
  3. Evaluating topic models for a set of hyperparameters (tm_eval.py and tm_eval_plot.py)
  4. Generating the final model using the best combination of hyperparameters (generate_model.py)
  5. Visualizing, interpreting and analysing the model (report1.ipynb, report2.ipynb and example_analyses.py) โ€“ note that this was not the focus of the workshop and hence only exemplary analyses are given

Used software packages

This example uses Python 2.7 because of some dependency issues (namely the pattern package for better lemmatization of German texts does not support Python 3).

These are the main software packages in use:

  • tmtoolkit for evaluating models in parallel, calculating some model statistics and visualizations
  • lda for topic modeling with LDA using Gibbs sampling
  • PyLDAVis and Jupyter Notebooks for interactive visualizations

All software dependencies can be installed via pip install -r requirements.txt.

Data

The data for the debates comes from offenesparlament.de.

License

Licensed under Apache License 2.0 (except for the data from offenesparlament.de which have their own license). See LICENSE file.

tm_bundestag's People

Contributors

internaut avatar

Stargazers

Olga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.