Political speech analysis with AI
iMEdD Lab
THANASIS TROBOUKIS
A.TROBOUKIS@IMEDD.ORG
Political Speech Analysis
iMEdD Lab
lab.imedd.org
A Special Edition of iMEdD Focused on the General Elections in Greece
A collaboration between humans and artificial intelligence to analyze the pre-election campaign speeches of Greece’s main political leaders: what issues they raise in the public discourse, what sentiments they convey, and to what extent polarization and populism can be detected in their rhetoric.
//02
Date of publication: May - June 2023
SENTIMENT
POLARIZATION
POPULISM
NER
//04
iMEdD Lab
lab.imedd.org
iMEdD Lab
lab.imedd.org
Topic analysis
CRITICISM | AGENDA
//05
TOPIC
iMEdD Lab
lab.imedd.org
//06
AI translation
Break down paragraphs
Receive speech in written form
The step-by-step process when receiving written speeches
THE ACTIVITIES PERFORMED BY THE AI AND THE TASKS UNDERTAKEN BY HUMANS
METHODOLOGY
Data validation
AI analysis
AI correction for grammar and syntax
1
2
3
4
5
6
iMEdD Lab
lab.imedd.org
//07
AI translation
AI correction for grammar and syntax
Receive the audiovisual form of speech
The step-by-step process when receiving audio or video speeches
THE ACTIVITIES PERFORMED BY THE AI AND THE TASKS UNDERTAKEN BY HUMANS
METHODOLOGY
1
2
3
... continue with the steps of written text
Break down paragraphs
AI models
DeepL
Translation via its API service.
Transkriptor
For transcribing audio-visual speeches via its web app.
ChatGPT 3.5 Turbo
For the analysis of populism, sentiment, polarization, NER, topic.
iMEdD Lab
lab.imedd.org
//08
Prompt engineering
How we used
chatGPT 3.5-turbo
A prompt contains any of the following elements:
iMEdD Lab
lab.imedd.org
//09
zero shot prompting
few shot prompting
Prompt engineering
How we used
chatGPT 3.5-turbo
A prompt contains any of the following elements:
iMEdD Lab
lab.imedd.org
//10
zero shot prompting
Classify the text into neutral, negative or positive sentiment.
DO NOT PROVIDE EXPLANATION.
Text: I think the food was okay.
Sentiment:
Format the answer as a dictionary with the following keys separated by commas: text, sentiment
Format the answer as an html table.
Style the html fancy.
prompt example
iMEdD Lab
lab.imedd.org
How we used
chatGPT 3.5-turbo
Prompt engineering
A prompt contains any of the following elements:
//11
zero shot prompting
Prompt engineering
How we used
chatGPT 3.5-turbo
A prompt contains any of the following elements:
iMEdD Lab
lab.imedd.org
//12
few shot prompting
This is awesome! // Positive
This is bad! // Negative
Wow that movie was rad! // Positive
What a horrible show! //
prompt example
Few-shot prompts enable in-context learning, which is the ability of language models to learn tasks given a few demonstrations.
iMEdD Lab
lab.imedd.org
Prompt engineering
A prompt contains any of the following elements:
//13
few shot prompting
How we used
chatGPT 3.5-turbo
iMEdD Lab
lab.imedd.org
Prompt engineering
A prompt contains any of the following elements:
f"Context: Polarisation is considered an important feature of political systems. Although usually seen as a negative trait, it is important to recognise that a certain degree of polarisation is reasonable and perhaps necessary.
Political polarization represents the intensity of binary, opposing political ideologies and their respective party identities.
Below are some critical features of a polarizing discourse:
1) Polarization occurs when a discourse promotes strong partisan or ideological divisions. This discourse promotes a representation of politics in dichotomous and binary terms, where society is divided into two major camps. A multitude of differences and contradictions are reduced to a single division. The remaining differences are downplayed.
2) The two political and ideological positions that this discourse constructs are presented as incompatible, and the political views and attitudes of citizens tend to diverge and cluster around these two opposing ideological positions. It creates a powerful and irreconcilable opposition between two camps, each challenging or even denying the legitimacy of the other. The political opponent becomes an enemy.
3) This discourse limits pluralism and fosters fanaticism. It results in the marginalization of intermediate or alternative views from the public sphere and, correspondingly, the squeezing and even the exclusion of smaller parties.
4) A discourse that increases polarization perceives and describes politics through the "us" vs. "them" distinction. There is no midpoint, everyone is asked to choose sides.
5) A discourse of polarization has a strong emotional dimension.
6) Polarizing discourse, in order to gain depth, often invokes deeply rooted social identities or social divisions that last over time and emphasizes opposing pairs of concepts and values (for example, modernization-tradition, progress-conservatism, workers-capitalists, right-left).
Question: How polarized is the following text in the range of 0 to 1? Give me only a single number without any explanations.
Answer:
Text: {text}"
iMEdD Lab
lab.imedd.org
Links
//15
iMEdD Lab
lab.imedd.org
Byline
//16
Idea & Project Coordination: Thanasis Troboukis, Kelly Kiki (iMEdD)
Journalistic Research/Analysis: Nota Vafea, Katerina Voutsina, Stefania Ibrishimova, Athina Thanasi, Kelly Kiki, Chrysoula Marinou, Thanasis Troboukis, Georgios Schinas (iMEdD)
IT Support: Christos Nomikos, Nikos Sarantos (iMEdD)
Scientific Advisor on Political Theory: Antonis Galanopoulos, PhD Candidate at the School of Political Sciences, Aristotle University of Thessaloniki
Software Development/ Data Analysis: Pavlos Sermpezis, Stelios Karamanidis, Dimitrios-Panteleimon Giakatos, Ilias Dimitriadis (Datalab, School of Informatics, Aristotle University)
Datalab Director (School of Informatics, Aristotle University): Professor Athena Vakali
Translation: Anatoli Stavroulopoulou, Tina Katoufa
Who worked on this project