📊 Election manifestos analysis

As part of the Natural Language Processing module at the DHBW Mannheim, the election manifestos of the FDP, CDU-CSU, Die Linke, Die Grünen and the AFD were analysed and compared.

The following points were analysed

  • ⚖️ Similarity of the manifestos

  • 👀 Sentiment of the manifestos

  • 📚 Topic modelling

  • 🧮 Most frequent words

✍🏼 Contributors

Niklas Scholz avatar avatar avatar

Niklas Scholz Luca Mohr Christian Schmid Jan Mühlnikel

  • Data preprocessing (Niklas Scholz)

  • Sentiment analysis (Jan Mühlnikel)

  • Similarity analysis (Jan Mühlnikel)

  • Summary (Luca Mohr)

  • Top words (Luca Mohr)

  • Wordclouds (Luca Mohr)

  • Topic modelling (Luca Mohr)

  • Development environment (Docker, Python venv) (Niklas Scholz)

  • Frontend React Application (Christian Schmid)

  • Charts (Christian Schmid, Niklas Scholz)

  • Report (All)

🚀 Getting started

🐍 Python

Download and install Python 3.11

🐳 Docker

Download Docker Desktop for Mac or Windows. Docker Compose will be automatically installed. On Linux, make sure you have the latest version of Compose.

⬇️ Download repository & run the application

Run the following command in your terminal to clone the repo.

git clone https://github.com/nklsdhbw/election-manifestos-analysis.git

🌐 Frontend

Change to the directory containing the docker-compose.yml file

cd election-manifestos-analysis/docker

Now start the containers using the following command

docker compose up --build

If you're having Node.JS already installed and dont want to run a docker container, you could also start the frontend via

cd election-manifestos-analysis/frontend
npm install
npm start

The frontend React-app will then be running at http://localhost:3000.

🔬 Analysis

If you want to execute all the Python scripts by yourself you'll need a python version with all the required packages. Luckily we did this part for you

First navigate to the python directory with the following command

cd python

Then create a new virtual environment called nlp by running the following command

python3.11 -m venv nlp

Afterwards activate your freshly created virtual environment

If you're using Windows then run

source nlp\Scripts\activate

If you're using MacOs or Linux run

source nlp/bin/activate

Now install all the required packages from requirements.txt by running

pip install -r requirements.txt

Then download the de_core_news_sm and de_core_new_lg dataset from spacy via

python -m spacy download de_core_news_sm
python -m spacy download de_core_news_lg

Lastly restart your IDE and you should be able to select nlp as your environment

💻 Tech-stack

DockerReactChart.jsTailwindCSSPython