1 of 16

Political speech analysis with AI

iMEdD Lab

THANASIS TROBOUKIS

A.TROBOUKIS@IMEDD.ORG

2 of 16

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

3 of 16

SENTIMENT

    • The dominant sentiment (sentiment analysis) expressed is categorized as positive, neutral, or negative.

    • A sentiment value on a scale of -1 to 1 indicates the negativity, neutrality, or positivity of the speech.

POLARIZATION

    • The level of political polarization in each speech.

    • Political polarization represents the intensity of binary, opposing political ideologies and their respective party identities.

    • A value on a scale of 0 to 1 indicates the level of political polarization in the speech.

POPULISM

    • The level of populism detected in each speech.

    • A value on a scale of 0 to 1 indicates the level of populism in the speech.

    • A populist discourse claims to express popular interests or demands against elites or the status quo.

NER

    • Named entity recognition (NER) is a natural language processing (NLP) method that extracts information from text.
    • We extracted: Groups of people, parties, countries, organizations,locations.

//04

iMEdD Lab

lab.imedd.org

4 of 16

iMEdD Lab

lab.imedd.org

Topic analysis

CRITICISM | AGENDA

    • The extent to which the leader’s words are focused on criticizing political opponents versus presenting the agenda of their party, including ideas, opinions, positions, and program proposals.

//05

TOPIC

    • The main topic of each speech. To conduct the thematic analysis, the working group has created a list of topics which may be expanded if required during the election period. The current list includes the following topics: abstention, accountability, agricultural policy, civil protection, corruption etc.

5 of 16

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

6 of 16

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

7 of 16

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

8 of 16

Prompt engineering

How we used

chatGPT 3.5-turbo

A prompt contains any of the following elements:

    • Instruction
    • Context
    • Input data
    • Output indicator

iMEdD Lab

lab.imedd.org

//09

zero shot prompting

few shot prompting

9 of 16

Prompt engineering

How we used

chatGPT 3.5-turbo

A prompt contains any of the following elements:

    • Instruction
    • Context
    • Input data
    • Output indicator

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

10 of 16

iMEdD Lab

lab.imedd.org

How we used

chatGPT 3.5-turbo

Prompt engineering

A prompt contains any of the following elements:

    • Instruction
    • Context
    • Input data
    • Output indicator

//11

zero shot prompting

11 of 16

Prompt engineering

How we used

chatGPT 3.5-turbo

A prompt contains any of the following elements:

    • Instruction
    • Context
    • Input data
    • Output indicator

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.

12 of 16

iMEdD Lab

lab.imedd.org

Prompt engineering

A prompt contains any of the following elements:

    • Instruction
    • Context
    • Input data
    • Output indicator

//13

few shot prompting

How we used

chatGPT 3.5-turbo

13 of 16

iMEdD Lab

lab.imedd.org

Prompt engineering

A prompt contains any of the following elements:

    • Instruction
    • Context
    • Input data
    • Output indicator

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}"

14 of 16

iMEdD Lab

lab.imedd.org

Links

//15

15 of 16

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

16 of 16