Robin's Blog

Previously Unpublicised Code: manifestoclouds

This entry in my series covers manifestoclouds: my code for producing word clouds from political party manifestos.

This is very simple, generic code that just ties together a few libraries – and is by no means restricted to just political party manifestos – but I keep it around because I find it useful occasionally. I use the Python WordCloud library and matplotlib to produce the word clouds – after manually extracting the text from the PDFs using one of a myriad of tools depending on your platform.

The results look quite nice – and the results for the political party manifestos are quite politically interesting:


Green Labour

Everyone is very focused on people and what the party will do, but there are some interesting differences. The Conservatives have the joint focus on continuing things they have been doing during their years in coalition, but also doing various new things now that they’re no longer ‘held back’ by the Lib Dems. The Green party focus a lot on local things, and have a focus on what the public (both in terms of people, and in terms of the public sector) can do. The Labour party are talking a lot about needs, but also talk about work more than the Tories (surprisingly!).

Anyway, ignoring the politics, the code is available on Github as usual.


Categorised as: Previously Unpublicised Code, Programming, Python


One Comment

  1. Ron Dunn says:

    Great work! I’ll definitely be using this code during our next elections.

Leave a Reply

Your email address will not be published.