Electoral Programs Search App

Hi there :wave:

I built a small app that allows users to search for keywords within the electoral programs of various German political parties. Next Sunday, 2021-09-26, we’ll have a federal election and I thought I could help people understanding the programs a bit better by building an app such as this.
Users can select an individual party to analyse the context of the matches against their keyword. This context is then analysed in terms of topics and entities (using TextRazor). A few people (myself included already) found some interesting results this way :smiley:

I tried to make the app look somewhat nice on mobile by removing the enlarge buttons for the charts so that the content is always centred (using this markdown / CSS “hack” I’ve seen mentioned here).

I’d be curious to hear what you think about this.

App: https://share.streamlit.io/caff9/wahlprogramm_reader/main/main.py
Code: GitHub - caff9/wahlprogramm_reader: A Streamlit app allowing for executing concurrent searches against several electoral programs published by various German political parties in the run-up to the federal election on 2021-09-26.

Cheers!

3 Likes

Sehr gelungene app. :clap:

Vielleicht hättest du noch Stoppwörter rausfiltern können (der, die, das), aber … vielleicht ist das auch gut so. Man kann zum Beispiel sehen, wer am meisten gendert (innen)

Nice app @caff9 - I don’t speak German, but got the impressions you compute which parties talk most about the search term, then how a set of themes/topics relates in that query context, then how a selected theme/topic breaks down into a set of concepts/entities. At each stage you show the matching text. (All easy to see from main.py).

Are the topics and entities pre-defined (if so, where), or are they extracted by TextRazor?

Thanks for sharing this.

Arvindra

Cool, vielen Dank für’s Feedback!
An den Funktionen für die Textanalyse ist noch einiges zu tun, das stimmt… Ich wollte nur schon mal eine erste Version vor der Wahl fertig haben :smiley:
Ich werde da noch einige Sachen anpassen, so wie z.B. eine vernünftige Erkennung von Zeilenumbrüchen.

Thanks for checking out the app :smiley:
The topics and entities are extracted by TextRazor. I would really like to find a good Python package which I could use for the topic extraction but so far - that is without diving into the whole world of training models, etc. - I haven’t found a solution that can extract nicely formatted topics and entities as it is the case with TextRazor.

1 Like

Indeed those auto-extracted topics and entities look pretty good. Have you tried transformers (BERT)?

1 Like

@caff9

I found BERTopic via some recent work @Charly_Wargnier has advertised.

A

1 Like

I had heard about BERT before but I haven’t tried working with it before.
Thank you for pointing out these resources to me, they look very promising! As I’m currently looking into an upgrade version of my app with more features, I’ll definitely look deeper into BERT in general and BERTopic in specific. Thanks again!
Have you worked with BERTopic so far? What were your experiences?

@caff9 - Sorry I have no experience with this. So much interesting stuff and so little time… let me know how you get on?

Hi @caff9,

This is indeed a nice app. Especially kind of ironic, if you search for the word freedom, the Pirate Party is right at the top. Also a few suggestions, a dropdown (topics from e.g. Wahlomat) or some simple charts exploring the most used words/topics and giving an overview could come in handy.

Best regards
Chris

1 Like

Sure, I’ll let you know :slightly_smiling_face: Don’t get to invest a lot of time on this currently though, so it’ll take a while for me to check this out.

Thanks for checking out the app @chris_klose, really appreciate it :slightly_smiling_face:
Cool, thank you for the suggestions - they make a lot of sense and I’ll consider them for the next iteration of this!

1 Like

@caff9 @chris_klose Did this app help you make your vote today?

@asehmi Good question :smiley:
In the end, it didn’t change my decision on which party to vote for.
I will say, however, that it actually helped me in diving into that specific party’s program a bit deeper and to also find out about topics for which that party’s line does not align with my preference. I was then able to compare that position with other parties‘ positions and in the end found that I still preferred that party. So I think it helped me a bit in making an informed choice.
The whole topic of working on the app and going through the programs also made me even more interested in politics so this little project was definitely time well invested.

1 Like

Wonderful result. I think I’ll try to adapt your app to an upcoming British election.

2 Likes

Wow cool, if you do that, pease let me know about it! Would definitely like to check it out! :smiley:

1 Like