---
title: "The Discursive Construction of Digitalization"
subtitle: "A Comparative Analysis of National Discourses on the Digital Future of Work "
date: "`r format(Sys.time(), '%d %B, %Y')`"
author:
  - name: "Matteo Marenco"
    institute: ["Scuola Normale Superiore"]
    url: 
    affiliation: Researcher
    affiliation_url:
    email: matteo.marenco@sns.it
    orcid_id: 
  - name: "Timo Seidl"
    institute: ["Centre for European Integration Research, University of Vienna"]
    url: https://www.timoseidl.com/
    affiliation: Post-Doc
    affiliation_url: https://eif.univie.ac.at/
    orcid_id: 0000-0001-6895-7114
output:
  reproducr::reproducr_manuscript:
    number_sections: false
    blinded: false
    keep_tex: true
  reproducr::reproducr_draft:
    toc: true
    toc_depth: 3
always_allow_html: true
thanks: "We would like to thank Dorothee Bohle, Guglielmo Meardi, and the participants of the ECPRpanel on the Politics, Governance and Regulation of Big Transformations for helpful comments on earlier versions of this paper."
reference-section-title: 'References'
section-refs-level: 1
section-refs-bibliography: 'References.bib'
# bibliography: 'References.bib'
csl: 'https://raw.githubusercontent.com/citation-style-language/styles/master/american-journal-of-political-science.csl'
link-citations: true
documentclass: article
geometry: margin = 2.5cm
fontsize: 12pt
header-includes:
- \usepackage{setspace}
- \doublespacing
- \setlength{\parindent}{2em}
- \setlength{\parskip}{0em}
- \usepackage{ragged2e}
- \renewcommand{\footnotesize}{\small \justify}
- \DeclareUnicodeCharacter{2009}{FIXME}
- \usepackage[all]{nowidow}
- \usepackage{booktabs}
- \usepackage{longtable}
- \usepackage{caption}
- \addtolength{\skip\footins}{2pc}
- \usepackage{amsmath}
- \usepackage{makecell}
---


```{r include=FALSE}

#set echo = FALSE, include = FALSE when knitting to pdf; set echo = TRUE, include = TRUE when knitting to html/notebook to preserve the code chunks

knitr::opts_chunk$set(echo = FALSE, include = TRUE)

knitr::opts_chunk$set(fig.pos = 'H')

knitr::opts_chunk$set(warning = FALSE, message = FALSE, fig.pos = 'H', cache.lazy = F)

#set table format to latex when knitting pdf otherwise to pandoc. This does not work perfectly as latex table styling can not straightforwardly be used in html, but it works well enough

options(
  knitr.table.format = function() {
    if (knitr::is_latex_output())
      "latex"
    else
      "pandoc"
  }
)

```


```{r  include=FALSE}
#setting up R

#loading/installing libraries

#if(!require("pacman", warn.conflicts = T)) install.packages("pacman")

pacman::p_load(eurostat, ggtext, glue, kableExtra, knitr, lubridate, patchwork, quanteda, RColorBrewer, stm, stminsights, textrank, tidyr, tidytext, tidyverse, udpipe, widyr)



# the replication data can be downloaded from the following link: 

# https://www.dropbox.com/sh/4qsja7xvlviq32e/AACcnjWq6UJzpQBznxGbtsRca?dl=0

# should there be any problems with the link, you can just contact Timo Seidl

# put the replication data into your directory and the load it like this

# you can put it in your working directory and then access it like this

folder <- getwd()
load(paste(folder, "Replication data, The discursive construction of digitalization.RData", sep = "/"))


```



# Abstract

New forms of work intermediation - the gig economy - and the growing use of advanced digital technologies - the new knowledge economy - are changing the nature of work. The digitalization of work, however, is shaped by how countries respond to it. But how countries respond to digitalization, we argue, depends on how digitalization is perceived in the first place. Using text-as-data methods on a novel corpus of translated newspaper and policy documents from eight European countries as well as qualitative evidence from interviews and secondary sources, we show that there are clear country effects in how digitalization is framed and fought over. Drawing on discursive-institutionalist and coalitional approaches, we argue that institutional differences explain these discursive differences by structuring interpretative struggles in favor of the social coalitions that support them. Actors, however, can also challenge these institutions by using the discursive agency to change these underlying support coalitions.


# The Discursive Construction of Digitalization


## Introduction

From manufacturing goods to building relationships, from daily business to everyday life, from credit scores to social scores: digital technologies are rapidly transforming the way we live our lives and run our economies. But digitalization is no force of nature. It does not just sweep over the world, leveling everything in its path. Rather, it is molded and channeled by the uneven landscape of history and politics. Take the ride-hailing platform Uber as an example.

Uber has aggressively rolled out its app in dozens of countries, probing the bounds of existing labor and taxi regulations. Different countries, however, have “responded in wildly different ways to [Uber] – from welcome embrace and accommodating regulatory adjustments to outright rejection and legal bans” [@Thelen.2018, p. 938]. And not only that. The advent of Uber also provoked very different discursive “flashpoints” [@Thelen.2018, p. 939] around which political struggles later revolved (e.g., taxation, competition, employment rights). These flashpoints, while resulting from institutional differences (e.g., different welfare systems), shaped the terms of public discourse on Uber. They led to the mobilization of different actors and the formation of different coalitions (e.g., taxpayers and regulators vs. Uber, Uber and consumers vs. drivers), which help explain the different regulatory responses.

This teaches us two lessons: first, platform companies like Uber are not only regulated differently; they are also talked and thought about differently (e.g., as a taxation vs. a labor law problem). Second, to understand political responses to digitalization, we need to understand how institutions influence the terms on which political struggles are fought. For country-specific characteristics “do not simply channel the same conflict in distinctive ways” but often “translate seemingly common trends into wholly different problems in divergent national contexts” [@Thelen.2018, p. 939].

An institutional theory of digitalization, therefore, not only needs to account for “diverse responses to common challenges” [@Steinmo.1992, p. 6] but also for how seemingly common challenges are “refracted into divergent struggles over particular national practices” [@Locke.1995, p. 338]. This refraction, we contend, happens in discourse, that is the process through which agents articulate and communicate the substantive content of ideas [@Schmidt.2008]. It is in discourse where actors voice their concerns about digitalization and express what they think are its defining features and central challenges [@Kjaer.2001; @Schmidt.2008; @Wueest.2013]. And  it is in discourse that global trends are translated into local problems – problems which subsequently influence the scope and nature of political solutions [@Hay.2002].

To be clear, our argument is not that discourse is all that matters. To the contrary, discourse itself is shaped by the politico-economic status quo and the social coalitions that underpin it. But digitalization also provides actors with an opportunity to build new coalitions and challenge this status quo [@Emmenegger.2021].In this article, we put forward a discursive-institutionalist analysis of the varying ways in which digitalization is framed and fought about in eight European countries. We use various text-as-data approaches [@Grimmer.2013] on a novel dataset of text corpora to show how actors talk about digitalization (sentiment analysis) and what they talk about (keyword extraction, topic modeling). In addition, we use more qualitative evidence from interviews and fieldwork as well as secondary sources to contextualize these findings and show how discursive agency manifests itself. Our datasets consists of two types of corpora: articles in quality newspapers to analyze ‘communicative discourse’ between political actors and the public; and policy documents such as government white papers or manifestos by trade unions and business groups to analyze ‘coordinative discourses’ among policy actors [@Schmidt.2008].

While digitalization is a multi-faceted process, we limit our analysis to one of its most important dimensions: the digital transformation of work [Neufeind.2018]. This refers to both the emergence of new forms of both online and offline work intermediation through digital platforms (‘gig economy’) [@deStefano.2016; @Prassl.2018]; and the growing use of advanced digital technologies like artificial intelligence to further rationalize the production process (‘new knowledge economy’) [@Brynjolfsson.2014; @Schwab.2016]. The former poses the problem of how to adapt labor regulations and social security systems to novel – and often highly precarious – forms of work; the later raises the question of how to prepare workers for – and compensate them in – a world in which machines can perform more and more tasks.

Our results suggest that digitalization is indeed talked and thought about in very different ways in different countries, and that these differences reflect underlying politico-economic differences [@Wueest.2013]. In particular we show that while socioeconomic factors matter, institutions are the primary source of national differences, or “country effects” [@Lloyd.2019] in how digitalization is discussed. Based on our findings, we develop a typology of digitalization discourses that captures how collaborative (vs conflictual) as well as how opportunity-focused (vs threat-focused) national discourses are. In addition, we show that while institutions shape how actors perceive novel phenomena, actors can also use their discursive agency to challenge or reinvent these institutions.

Our paper makes three contributions. First, we provide a comprehensive mapping of digitalization discourses in a diverse set of eight European countries, showing that digitalization is far from being the same problem everywhere. Second, we theorize and empirically demonstrate how institutions – and their underlying support coalitions – mediate the digital transformation of societies and economies by shaping how digitalization is framed and fought over. Third, we show how novel text-as-data methods can be used to answer discursive-institutionalist questions, even and perhaps especially when they are comparative in nature.

We proceed as follows. We will first present our research questions and elaborate on our argument. We then outline our theoretical framework. Next, we explain our dataset and methodological approach, and discuss our empirical results. We conclude with a brief summary of our results and a discussion of the contributions and shortcomings of our paper.


##	Research Questions & Argument

Technological change is often portrayed as an unstoppable, tsunami-like force that simply rushes over societies. Economic history, however, is full of examples of ‘successful’ resistance to or differential adaption of new technologies [@Frey.2019]. In fact, whether new technologies are outrightly banned or eagerly introduced – or anything in between – “depends on who stands to gain from them and the societal distribution of political power” . Technological change, in other words, is a profoundly political and politically contested process whose outcome depends not just on the technologies themselves but on how countries react them . And these reactions can differ quite dramatically.

But how to explain this variation? While much work on digitalization is rather devoid of a comparative perspective, an emerging ‘varieties-of-digitalization’ literature has started to pay attention to ‘country effects’ in the way that digitalization is viewed and responded to [@Lloyd.2019; @Thelen.2018]. In this paper, we build on this literature – as well as existing country case studies – to draw attention to three things: first, to the systematic differences in the way that digitalization is thought and talked about in different countries; second, to the importance of institutions in structuring the way digitalization is understood; and third, the limited although important role of discursive agency in challenging and changing existing institutions. We address three research questions. First, are there relevant and theoretically meaningful differences in the way countries talk about digitalization? Finding descriptive differences in discursive tone or content is the minimal condition for a discursive-institutionalist account of country effects. Put differently, mapping discursive diversity is a precondition for explaining it.

Second, to the extent that there are such ‘country effects’, how do we explain them? Why do countries perceive digitalization differently, and what is the relative importance of socioeconomic versus institutional factors?

Third, to what extent do different discourse merely reflect politico-economic differences – economic or institutional – and to what extent do they leave room for discursive agency? In other words, is discourse mainly a locus of continuity where structurally or institutionally powerful actors express their interests? Or is it a locus of change in which actors can challenge existing ways of thinking about and doing things? The example of Uber has shown that different discursive flashpoints organize debates around platform work and thus shape the coalitions in favor of specific regulatory responses [@Thelen.2018]. But do these discursive flashpoints merely reflect underlying institutional differences, or is there room for genuine discursive agency?

Our discursive-institutionalist conjecture is that discourses on digitalization i) differ systematically across countries (the descriptive part) because ii) institutional differences give different meaning and relevance to it (the institutional part); and iii) because actors can use discourse to build new coalitions or drive a wedge between existing ones, thereby challenging and changing existing institutions (the agency part).

This addresses the two sides of the structure-agency debate in institutional theory. On the one hand, institutions are said to structure the ways in which novel problems are perceived, conceived, and ultimately assimilated. On the other hand, such accounts are criticized for being overly deterministic and for downplaying the opportunities that novel problems present to actors that are interested in changing (or shoring up) institutional arrangements. These two sides, however, are not incompatible. As the next section fleshes out, they can be reconciled by understanding (discursive) agency as the “coalitional work” that goes into creating, maintaining and changing institutions, while acknowledging the difficulties involved in challenging an institution’s underlying support coalition [@Capoccia.2016; @Emmenegger.2021; @Hall.2016]. 

Discourse matters because it offers a window into the operation of both institutional structure and agency: it is in discourse that cultural categories are institutionalized and novel problems assimilated to existing ways of thinking [@Capoccia.2016, p. 1104]. But it is also in discourse that actors contest the meaning and legitimacy of an institution [@Schmidt.2010, p. 15].  A discursive-institutionalist analysis thus allows for more “rounded accounts of agency within institutional settings” [@Bell.2012, p. 718] – accounts that take seriously both the ‘partial bite’ of institutions [@Capoccia.2016] and the possibility of discretionary spaces.


## Theoretical Framework

Institutionalism evolved as a research program focusing on how institutions structure actors’ behavior, thus explaining “policy continuities over time within countries and policy variation across countries” [@Steinmo.1992, p. 10]. More recently, institutionalists have turned their attention to the role of actors in changing institutions by exploiting the inevitable incompleteness and ambiguity of institutions [@Streeck.2005, p. 14]. What an institution “really means” is never quite clear but is negotiated in a continuous “interpretative struggle” over its meaning, scope, and legitimacy [@Streeck.2005, pp. 14–15]. Actors can thus, in principle, challenge and change the institutions in and under which they operate.

This growing focus on agency, however, raises the “paradox of plasticity” [@Hall.2016, p. 39]: if agency and institutional change are ubiquitous, what remains of the very stickiness and ‘patterning’ effects that inspired institutionalist analysis in the first place? The “coalitional turn” [@Emmenegger.2021, p. 2] in institutional analysis is meant to address this problem [@Hall.2009b]. It conceptualizes institutions “as the product of social coalitions” [@Hall.2016, p. 39] and agency in terms of “the creation and maintenance of social coalitions that stabilize or challenge institutions” [@Emmenegger.2021, p. 2]. The advantage of such a coalitional understanding of institutions is that it allows to “strike a middle ground between characterizing institutions as absolutely constraining or as malleable tools in the hands of powerful actors” [@Capoccia.2016, p. 1100].  While institutions are “creatures of coalitions” [@Hall.2016, p. 42] and therefore rely on the continuing support of actors, they also sustain the coalitions that support them [@Hall.2016] – for example, by providing incumbent coalitions with material benefits [@Pierson.2000] or control over the timing of institutional reform [@Capoccia.2016].^[At the same time, collective action problems make it difficult for challenger coalitions to unseat incumbent coalitions [@Emmenegger.2021].]

Another way in which institutions ‘bite’ – and the one on which we focus here – is through the “institutionalization of cultural categories” [@Capoccia.2016, pp. 1102–1107]. Institutions not only play a regulative role. They also play a constitutive role [@Emmenegger.2021, p. 7] by shaping how “different groups come to have particular beliefs and conceptions of the world, their roles in it and their interests” [@Whitley.2007, p. 549]. “‘Interpretative feedback effects” [@Capoccia.2016, p. 1102] tilt the interpretative struggles over institutions in favor of their support coalitions. Reformers, meanwhile, need to do a lot of  “‘definitional work’ to change established categories and ways of thinking [@Capoccia.2016, p. 1106]. Novel problems are therefore often viewed in light of existing national models and, as a result, problem definitions and policy solutions follow ideational path dependencies [@Cox.2004; @Kjaer.2001]. 

Discursive institutionalists have theorized this constitutive effect of institutions through the concept of background ideational abilities, which allow actors to create and maintain institutions [@Schmidt.2008, p. 314]. But they have also argued that institutions are not as ‘sticky’ and actors not as ‘unthinking’ as they are often made out to be. This is because actors also have foreground ideational abilities which they can use “to think, speak, and act outside their institutions even as they are inside them, to deliberate about institutional rules even as they use them, and to persuade one another to change those institutions or to maintain them” [@Schmidt.2008, p. 314].

Conceptualizing actors as endowed with both background and foreground ideational abilities addresses another paradox of institutionalist theory: the “paradox of embedded agency”; it explains how actors, “whose belief and actions are strongly shaped by existing institutions [can] brake with these very same institutions and innovate” [@Emmenegger.2021, p. 6]. Together, coalitional and discursive institutionalist perspectives allow us to understand two things at the same time: i) how the common trend of workplace digitalization is not in fact “translated into common pressures in all national economies” but – through the constitutive power of institutions – “refracted into divergent struggles over particular national practices” [@Locke.1995, p. 338]; and ii) how actors can use their discursive agency over digitalization to challenge coalitions, build new ones, and thereby change these national practices.  

On the one hand, actors frame novel problems in ways that make defection from existing institutions less likely. For example, they stress certain aspects (e.g., taxation) of digitalization more than others (e.g., employment status), thereby rallying the supporters of a tax-based welfare system behind certain types of regulations [@Thelen.2018]. ^[ Following @Entman.1993, p. 53, we understanding framing as “selecting and highlighting some features of reality while omitting others” and discourse, following @Schmidt.2010, as the interactive exchange of such frames.]  By asserting the continuing relevance and legitimacy of established ways of doing and thinking about things, these frames shore up the coalitions that support the institutional status quo [@Capoccia.2016, p. 1105]. On the other hand, actors can frame a novel problem as an opportunity for change – or as necessitating it. By pointing to the inadequacy of the institutional status quo, these frames can be used to build new coalitions or drive a wedge between existing ones. 

In sum, by taking seriously the coalitional underpinnings of institutions as well as the effect of (institutional) context on actors’ background ideational abilities and the possibility of agency that exists because of actors’ foreground ideational abilities, this approach strikes “a middle ground between characterizing institutions as absolutely constraining or as malleable tools in the hands of powerful actors” [@Capoccia.2016, p. 1100]. Institutions are created, maintained, and challenged by social coalitions, and a key part of their coalitional work is the definitional work of framing novel problems in ways that either reassert existing practices – or break with them.  


##	Empirical Strategy & Data


Testing the twin arguments of institutional structuring and discursive agency requires combining two empirical strategies. First, we need ways to systematically assesses whether and how discourses on digitalization differ across countries. Second, we need ways to connect these findings to the actual political strategies of social actors – their efforts in defending and defecting from existing institutions, and in keeping together or breaking apart the coalitions that sustain these institutions. The first task is accomplished using methods of quantitative text analysis; the second one through triangulating these findings with case studies based on fieldwork and secondary sources.


For the quantitative text analysis, we compiled two novel text corpora for eight European countries: France, Germany, Ireland, Italy, Poland, Spain, Sweden, and the United Kingdom. The rationale for our case selection was to investigate discursive diversity among countries that share some basic commonalities. Each of our eight countries, with the partial exception of Poland, is an advanced capitalist democracy, and each was, for the period under study, a medium-sized to large member of the European Union. Despite these similarities, the countries under study also differ in important respects, both with regard to the structure of their economy and with regard to their institutional makeup. This constrained diversity provides us with the appropriate setting to study how structural and institutional diversity is reflected in discourse.

The first corpus we collected consists of `r nrow(full_corpus%>%filter(discourse == "communicative"))` newspaper articles that directly relate to the digitalization of work and were published between 2013 and 2019. Articles were collected from major national newspapers, either directly or via Factiva. We prioritized quality over quantity [cf. @Nicholls.2020], selecting only articles that contained an explicit reference to the gig economy, workplace automation and robotization (including artificial intelligence), or the fourth industrial revolution or Industry 4.0 in their headline or lead paragraph (for details, see online ppendix \@ref(AppendixA1)). This corpus represents what Schmidt calls the communicative discourse between policymakers and the public and is broadly reflective of the overall public discourse on digitalization in a country.

The second corpus consists of `r nrow(full_corpus%>%filter(discourse == "coordinative"))` (sometimes split) documents published between 2012 and 2019 by major social partners, namely unions, governments or ministries, and employer organizations. Following this actor-based logic, documents were collected from the web, based on relevant search strings and available lists of the main stakeholders in each country (e.g., the national member organizations of the European Trade Union Confederation). Longer documents (over 40.000 characters) were split chapter-wise or similarly to have more and more meaningful units of analysis (for details, see online appendix \@ref(AppendixA2)). This second corpus represents what Schmidt calls the coordinative discourse among policymakers and is broadly reflective of the elite discourse on digitalization.

Substantively, both corpora cover the digitalization of work, which we understand as a two-pronged process. The first prong refers to new platform business models that enable and control novel interactions between buyers and sellers of labor; the second prong refers to the ways in which digital general-purpose technologies increasingly affect the ways in which business organize production in both the service and the industrial sector (‘Industry 4.0’). We thus distinguish between new forms of online and offline work intermediation through digital platforms – what is often referred to as the ‘gig economy’ [@deStefano.2016; @Prassl.2018]; and the growing use of advanced digital technologies that promise to transform the production process more generally – what is variously referred to as the second machine age, the fourth industrial revolution, or the (new) knowledge economy [@Brynjolfsson.2014; @Schwab.2016].

These two dimensions of digitalization come with different challenges. The former intensifies existing trends of workplace casualization [@deStefano.2016]. It poses the problem of how to adapt labor regulations and social security systems to minimize the costs while maximizing the benefits of new, digitally intermediated forms of work. The latter intensifies existing trends of industrial and service-sector automation and routine-biased technological change [@Frey.2019]. This raises the question of how to make sure that workers have the necessary skills to remain in the labor market or are provided with alternative sources of income.


Both corpora were automatically translated into English, using Google’s Translate API. Other studies have shown that this works as well as gold-standard translations for both dictionary-based and unsupervised methods of text analysis [@Proksch.2019; @Vries.2018].
Building on these studies, we use the translated corpora as input for various methods of automated text analysis. ^[For translation, preprocessing, NLP annotation, and the analyses, we mainly relied on the R packages googleLanguageR [@Edmondson.2020], quanteda [@Benoit.2018], spacyr [@Benoit.2020b], stm [@Roberts.2018] and udpipe [@Wijffels.2019] as well as the tidyverse packages [@Wickham.2019].] While these methods inflict a certain degree of ‘semantic violence’ on texts, they can also be extremely useful when carefully validated and interpreted, which we discuss below [@Benoit.2020]. In addition, it is crucial to align theory and method. In this paper, we assume that the frequency of certain words is substantively meaningful (e.g., because it tells us something about dominant framings), so we can use bag-of-words approaches like topic models [cf. @Nicholls.2020]. If, however, we assumed words derive their meaning from ‘the company they keep’ and are interested in how their meaning changes over time or across contexts, word embeddings would be a more fitting approach. 

In this paper, we use three text-as-data methods that match our theoretical interest in the tone and content of discourse. First, we are interested in how digitalization is talked about in a given country. For that purpose, we use sentiment analysis to identify the relative number of positive versus negative terms in different documents. We use the Lexicoder Sentiment Dictionary, which was specifically designed for political text [@Young.2012], taking into account negators (positive negatives and negative positives) as well. We cross-validate this approach by using four additional dictionaries (for details, see online appendix \@ref(AppendixB1)).

Second, we are interested in what is said in a given country. To investigate this, we use various keyword extraction techniques as well as structural topic modeling. ^[We also use a version of word vectors. For details and results, see online appendix \@ref(AppendixB3)]. Keyword extraction techniques make it possible to identify words or n-grams that capture essential content. We use four of such techniques: the RAKE algorithm, the textrank algorithm and sentence-based as well as skipgram-based co-occurrence metrics (for details, see online appendix \@ref(AppendixB2)).

Topic modeling allows us to identify common themes in our corpus. Topics are modeled as probability distributions over words and documents as probability distributions over topics [@Blei.2012]. Put differently, topics are understood as combinations of words (or n-grams) and documents as mixtures of topics. Structural topic modeling extends this basic topic model by allowing observed covariates to influence the proportion of a document devoted to a topic (the topic prevalence), which allows us to estimate the conditional expectation of a topic occurring given that a document is from a certain country or part of the communicative discourse. We chose a topic model with k = 60 topics, some of which we subsequently combined into “frame packages” [@Nicholls.2020, p. 11]. Online appendix \@ref(AppendixB4) provides a detailed discussion of our choice of k, preprocessing steps, interpretation, and validation, as well as a complete list of topics with terms, labels, and assigned frame package.

We rely on qualitative evidence to complement our quantitative findings. In particular, we relied on in-depth analysis of relevant governments’ and social partners’ policy documents, academic as well as journalistic sources. For four countries in our sample – France, Spain, Italy, and Germany – we complemented this document analysis with semi-structured interviews with members of employment Ministries, social partners concerned with the digitalization of work, as well as platform activists and experts (see appendix). Where we did not collect interview data, we rely on the aforementioned secondary literature only. The purpose of such qualitative data is two-fold: first, to let the quantitative discourse analysis ‘come to live’, i.e., to show how discursive differences relate to what actually happens ‘on the ground’; and second, to zero in on the relative importance of institutional structure and discursive agency which we can only superficially analyze quantitatively.


##	Results & Discussion


Do discourses on the digital future of work differ in tone and content across countries, and if so, how do we explain these differences? Here, we first look at the tone of discourse and tentatively derive a typology of digitalization discourses. We then flesh out this typology by looking at the content of discourse. In both cases, as highlighted above, we combine quantitative evidence – from the sentiment analysis in the case of discursive tone and from keyword extraction methods and topic models in the case of content – with qualitative data from secondary sources and interviews. 


### The Tone of Discourse


The relative number of positive versus negative words is a good proxy for a country’s view of digitalization: is it perceived as something bad, threatening, destructive? Or as something good, promising, useful? Figure \@ref(fig:sentimentplot) plots discursive sentiment across different countries, for different dictionaries as well as separately for coordinative and communicative discourses (with values averaged across dictionaries).^[In online appendix \@ref(AppendixB1), we provide wordclouds with the most commonly matched positive of negative words to illustrate what a positive or negative tone means and to further validate this approach. We thank an anonymous reviewer for this suggestion.]  A first finding is that Sweden has by far the most positive discourse. Importantly, this cannot be explained by the country’s economic position alone. The UK or Ireland also have service-dominated economies with many companies close to the digital frontier. But they perceive digitalization more negatively. We argue that what explains these differences is not the structure of Sweden’s economy but the nature of its institutions.

Specifically, Sweden has an institutionalized tradition of proactively and inclusively adapting to technological change. This makes digitalization a lot less scary [@Katzenstein.1985]. Sweden’s embracing view of digitalization is epitomized by the opening quote of a recent report by its digitalization commission: *Tempora mutantur nos et mutamur in illis* – the times change, and we change with them. “In Sweden”, as the Swedish minister for employment and integration, Ylva Johansson, put it, “if you ask a union leader, ‘Are you afraid of new technology?’ they will answer, ‘No, I’m afraid of old technology. (...) The jobs disappear, and then we train people for new jobs. We won’t protect jobs. But we will protect workers” [@Goodman.2017]. Institutionally, this is reflected, among other things, in the country’s job security councils, which are jointly run by employers and trade unions and which give intensive support and retraining to people when they are laid off. As we will further see below, Sweden’s ability to collaboratively negotiate technological change fundamentally changes the country view of and reaction to digitalization. By contrast, Poland stands out by having a particularly negative coordinative discourse, precisely because it lacks an established tradition of social and policy dialogue. As a result of this difficulty of building cross-class coalitions, there is a conspicuous lack of forward-looking plans and institutionalized cooperation in shaping digital change. 

The UK and Ireland also lack such a system of institutionalized cooperation between winners and losers of technological change. This results in a particularly negative communicative discourse and a government-dominated coordinative discourse, which pushes Union into voicing their concerns directly to a receptive public. The Irish government, for example, is very sanguine about digitalization, having long espoused an active policy of catering to tech companies and casting Ireland as a digital frontrunner [@Brazys.2017]. By contrast, the Irish public appears more worried about digitalization’s potential downsides and inequities, as evidenced by the much more negative discourse on the digital future of work. Our findings dovetail with a recent study, which finds that at least 25 percent of the Irish population finds itself excluded from an increasingly digital society because of socio-economic reasons, and almost half describe themselves as lacking digital skills [@Accenture.2020]. Similarly, the British government frames digitalization very positively, but its unilateral celebration of digitalization as a vindication of and boost to the British way does not chime well with a more skeptical public.



```{r eval=FALSE}

#This code chunk will not be evaluated but is just meant to show how the sentiment scores were created.

#first for the lexicoder dictionary reported in the main paper, below for the dictionaries in the appendix

# some transformations

corpus <- corpus(full_corpus)


dictionary <- data_dictionary_LSD2015


tibble(
  negative = gsub("artificial","", data_dictionary_LSD2015$negative),
  positive = data_dictionary_LSD2015$positive,
  neg_negative = data_dictionary_LSD2015$neg_negative,
  neg_positive = data_dictionary_LSD2015$neg_positive
          )


dictionary$negative<- dictionary$negative[which(dictionary$negativedictionary$negative!=dictionary$negative[["artificial"]])]

sentiment_lexicoder <- tokens_lookup(tokens(corpus, include_docvars = T), dictionary = dictionary, 
                                     exclusive = FALSE, nested_scope = "dictionary")

memory.limit(45000)


sentiment_score_lexicoder <- convert(dfm(sentiment_lexicoder), to = "data.frame")


sentiment_score_lexicoder_df <- sentiment_score_lexicoder%>%
  select(1:5)%>%
  rename(doc_id = document)%>%
  mutate(sentiment_polarity = (positive+neg_negative)-(negative+neg_positive))


lexicoder_df <- left_join(sentiment_score_lexicoder_df, full_corpus)


#now bootstraped means by country and discourse type




sentiment_score_lexicoder_boot <- rcompanion::groupwiseMean(
  sentiment_polarity ~ country + discourse,
  data = lexicoder_df,
  R = 10000,
  boot = T,
  conf = 0.95,
  bca = T,
  traditional = F
)


#save(sentiment_score_lexicoder_boot, sentiment_score_lexicoder, lexicoder_df, file = "C:/Users/timos/Dropbox/processed-data/lexicoder_sentiment.RData")


#first, we get several dictionaries and rename and transform the sentiment scores such that 1 is positive and 0 is negative

sentiment_dictionary_bing <- get_sentiment_dictionary("bing")%>%
  dplyr::rename(term = word, 
          polarity = value)

sentiment_dictionary_afinn <- get_sentiment_dictionary("afinn")%>%
  dplyr::rename(term = word, 
                polarity = value)%>%
  dplyr::mutate(polarity = ifelse(polarity>0, 1, ifelse(polarity<0, -1, NA)))%>%
  filter(term != "some kind")#has polarity score 0

sentiment_dictionary_nrc <- get_sentiment_dictionary("nrc") %>%
  dplyr::rename(term = word,
                polarity = sentiment) %>%
  dplyr::mutate(polarity = ifelse(polarity == "positive", 1, ifelse(polarity == "negative",-1, NA))) %>%
  select(c(term, polarity))%>%
  filter(!is.na(polarity))


sentiment_dictionary_syuzhet <- get_sentiment_dictionary("syuzhet")%>%
  dplyr::rename(term = word, 
                polarity = value)%>%
  dplyr::mutate(polarity = ifelse(polarity>0, 1, ifelse(polarity<0, -1, NA)))


#we also add predefined amplifiers, negators, and deamplifiers and use the txt_sentiment function to calculate sentiment scores by plugging in the different dictionaries

negators <- lexicon::hash_valence_shifters[y == 1]$x
amplifiers <- lexicon::hash_valence_shifters[y == 2]$x
deamplifiers <- lexicon::hash_valence_shifters[y == 3]$x

sentiment_afinn <- txt_sentiment(x = udpipe_annotated, 
                        term = "lemma",
                        polarity_terms = sentiment_dictionary_afinn, 
                        polarity_negators = negators,
                        polarity_amplifiers = amplifiers, 
                        polarity_deamplifiers = deamplifiers)

sentiment_bing <- txt_sentiment(x = udpipe_annotated, 
                           term = "lemma",
                           polarity_terms = sentiment_dictionary_bing, 
                           polarity_negators = negators,
                           polarity_amplifiers = amplifiers, 
                           polarity_deamplifiers = deamplifiers)

sentiment_nrc <- txt_sentiment(x = udpipe_annotated, 
                           term = "lemma",
                           polarity_terms = sentiment_dictionary_nrc, 
                           polarity_negators = negators,
                           polarity_amplifiers = amplifiers, 
                           polarity_deamplifiers = deamplifiers)

sentiment_syuzhet <- txt_sentiment(x = udpipe_annotated, 
                           term = "lemma",
                           polarity_terms = sentiment_dictionary_syuzhet, 
                           polarity_negators = negators,
                           polarity_amplifiers = amplifiers, 
                           polarity_deamplifiers = deamplifiers)


# We then combine the dictionaries first with meta-data from the corpus and then with each other

sentiment_score_afinn <- sentiment_afinn$overall%>%
  right_join(full_corpus, by = "doc_id")%>%
  dplyr::mutate(method = "afinn")


sentiment_score_bing <- sentiment_bing$overall%>%
  right_join(full_corpus, by = "doc_id")%>%
  dplyr::mutate(method = "bing")


sentiment_score_nrc <- sentiment_nrc$overall%>%
  right_join(full_corpus, by = "doc_id")%>%
  dplyr::mutate(method = "nrc")


sentiment_score_syuzhet <- sentiment_syuzhet$overall%>%
  right_join(full_corpus, by = "doc_id")%>%
  dplyr::mutate(method = "syuzhet")


sentiment_score_countries <- rbind(sentiment_score_afinn, 
                                 sentiment_score_bing,
                                 sentiment_score_nrc,
                                 sentiment_score_syuzhet)%>%
  filter(!is.na(sentences))



#Lastly, we calculate bootstrapped means and confidence intervals for the data grouped by country and dictionary and country and discourse type


#calculate grouped bootstrapped means

sentiment_score_countries_boot <- rcompanion::groupwiseMean(
  sentiment_polarity ~ country + method + discourse,
  data = sentiment_score_countries,
  R = 10000
  boot = T,
  bca = T,
  traditional = F
)


sentiment_score_countries_boot_discourse <- rcompanion::groupwiseMean(
  sentiment_polarity ~ country + discourse,
  data = sentiment_score_countries,
  R = 10000,
  boot = T,
  bca = T,
  traditional = F
)







```





```{r sentimentplot, fig.cap= "Discursive sentiment across countries and discourse types with 95 \\% bootstrapped confidence intervals (R = 10000)", out.extra='angle=90',fig.align="center", fig.width=9, fig.height=6}
sentiment_score_lexicoder_boot%>%
  mutate(sentiment = Mean,
       upper = Bca.upper,
       lower = Bca.lower)%>%
  mutate(discourse = as.character(
    glue("{discourse}<br><span> discourse")
  ))%>%
  ggplot(aes(
    reorder_within(country, sentiment, discourse),
    sentiment,
    fill = discourse
  ))+
  scale_x_reordered() +
  geom_bar(stat = "identity", position = "dodge") +
  geom_errorbar(aes(ymin = lower, ymax = upper))+
  facet_wrap( ~ discourse, scales = "free") +
  theme_minimal(base_size = 20)+
  coord_flip() +
  labs(x = "",
       y = "") +
  scale_fill_grey()+
  theme(
    strip.background=element_rect( color=NA),
    strip.text=element_markdown(size = 12, lineheight = 1.1),
    legend.position = "none"
  )
```


There are large class and regional disparities in Britain when it comes to digitalization, and less trust in the country’s ability to find collaborative solutions.  Unions, for example, are irritated by the government unilateral approach, which did not involve them in drafting the UK’s digital industrial strategy, and which one-sidedly stressed the benefits of the flexible ‘British way’ in its response to the Taylor Review of Modern Working Practices [@UKGovernment.2018a]. This response struck many as rather tone-deaf at a time when digitalization threatened to exacerbate the downsides of the flexible British labor market. Again, it is institutions – in this case a lightly regulated labor market and a unilateral (as opposed to corporatist) style of policymaking – result in large discrepancies between a relatively cheerful discourse by the government and a much more negative discourse among the public. 


Importantly, without having a seat on the table and without being listened to, Unions resort to more dramatizing discursive strategies. They also shift their focus from the coordinative to the communicative discourse and address the public more directly, which explains the quite positive coordinative and the quite negative communicative discourse [cf. @Schmidt.2008, pp. 312–313]. . Using an aggressive style of campaigning that highlighted the conflicts and inequities in the British labor market, the Independent Workers Union of Great Britain (IWGB), for example,  successfully raised awareness for the working conditions not just of gig workers but of precarious workers in general. As the IWGB’s vice-president Mags Dewhurst puts it, “this isn’t just about the gig economy. All business is going more and more digital, leaner and leaner. (...) Next, it will be banking and retail. These bad practices have to be stopped now”[@Roberts.2018b]. Thus, the IWGB has used the spotlight that digital platforms have put on the inequities of the British labor market to challenge the support coalition behind the flexible ‘British way’, for example by pointing to the wide-spread non-enforcement of labor rights, which is not limited to platform companies [@Roberts.2018b]. 

In sum, the tone of public discourse clearly differs across countries. As the above discussion has hinted at and as the analysis of discursive content will flesh out, discourses differ along two dimensions. The first dimension relates to how collaborative policymaking is. Specifically, corporatist countries seem to be better at mitigating fears of technological disruption. This is because the losers of technological change can plausibly assume that they will either be compensated in the digital future or prepared for what it brings, allowing for broader coalitions in favor of technology-embracing policies [@Katzenstein.1985; @Ornston.2012]. The stakes are higher in countries with a more conflictual style of policymaking, where each side has to fear that the other gets its way and one ends up getting the short end of the stick, which inclines groups to fight for their short-term interest. The second dimension has to do with whether previous experiences with technological change and a country’s politico-economic makeup incline countries to perceive digitalization as an opportunity or as a threat. Is my country likely to benefit from digitalization, can it be an opportunity to overcome existing problems or will it make them worse? While the first dimension reflects purely institutional differences, the second dimension has both economic and institutional elements (e.g., the distance to the digital frontier, the nature of the labor market).



Table \@ref(Tab:typology) brings these two dimensions together, distinguishing between four ideal typical discourses. If the policymaking style is collaborative and digitalization is viewed as an opportunity, a proactive discourse dominates in which digitalization is embraced and the emphasis is on investments that help workers and companies survive and thrive in a digital economy. This makes it much easier to build broad coalitions that support future-oriented institutions such as (re-)training programs. If the policymaking style is at least somewhat collaborative but digitalization is viewed as a threat, the focus is on how to passively compensate individuals and business that stand to lose from digitalization. If the policymaking style is conflictual and digitalization is viewed as an opportunity, the discourse will be unilateral in the sense of different actors emphasizing their own and often conflicting interpretations of how digitalization can benefit society. If the policymaking style is conflictual and digitalization is viewed as a threat, a Luddite discourse will emerge in which actors try to stop or reverse digitalization to the extent that it hurts them. This will lead to narrow, conflicting coalitions, which makes it hard to build future-oriented institutions. The following paragraphs will add empirical flesh to these conceptual bones by zeroing in on the content of discourse, and by showing how actors can use their discursive agency to either confirm the discursive status quo or shift discourses from one quadrant to another.

\begin{table}[h]
	\caption{Typology of Digitalization Discourses}
	\begin{tabular}{@{}llll@{}}
		\multicolumn{2}{l}{\multirow{2}{*}{}} & \multicolumn{2}{c}{\textit{Policymaking Style}}                       \\ \cmidrule(l){3-4} 
		\multicolumn{2}{l}{}                  & \multicolumn{1}{l|}{Collaborative} & \multicolumn{1}{l|}{Conflictual} \\ \cmidrule(l){2-4} 
		\multicolumn{1}{c}{\multirow{2}{*}{\textit{\makecell{Digitalization \\ Perception}}}} &
		\multicolumn{1}{l|}{Opportunity} &
		\multicolumn{1}{l|}{\textbf{Proactive Discourse}} &
		\multicolumn{1}{l|}{\textbf{Unilateral Discourse}} \\ \cmidrule(l){2-4} 
		\multicolumn{1}{c}{} &
		\multicolumn{1}{l|}{Threat} &
		\multicolumn{1}{l|}{\textbf{Compensatory Discourse}} &
		\multicolumn{1}{l|}{\textbf{Luddite Discourse}} \\ \cmidrule(l){2-4} 
	\end{tabular}
	\label{Tab:typology}
\end{table}



###	The Content of Discourse


Not only do digitalization discourses differ in tone, they also importantly diverge in content. Figures \@ref(fig:keywords) depicts the most important keywords identified by three keyword extraction algorithms.^[ For details on these methods, and for similar results using the textrank algorithm, see online appendix \@ref(AppendixB2).]  It depicts – with size indicating importance – the unigrams and bigrams that we can think of as most ‘essential’ to the communicative (black) and coordinative (grey) discourses in the respective countries. They capture the issues around which national discourses revolve. Figure \@ref(fig:topicmodel) depicts the estimated effect of the country covariate on the prevalence of different topics (or aggregation of topics). It depicts the conditional expectation of a bundled set of topics or ‘frame package’ to occur in a document given that this document is from a given country. It thus helps us answer the question which topics are important in some countries relative to others.

So far, we have encountered Sweden as a country with a proactive discourse on digitalization. But while some aspects of digitalization play into Sweden’s hands, others challenge core pillars of its social model. On the one hand, the country’s corporatist institutions and “ideology of social partnership” give it an ability “to live with change” instead of resisting it [@Katzenstein.1985, p. 32, 211; @Ornston.2012]. This “asymmetric embrace of markets” [@Pontusson.2011, p. 107] – a perfect example of ideational path-dependency [@Cox.2004] – credibly ensures flexible-yet-inclusive adjustments. This stabilizes coalitions for forward-looking adjustments, which, as we have seen, manifests itself in a remarkably positive discourse on digitalization. On the other hand, platform companies like Uber challenge the country’s tax-based welfare state and collective bargaining tradition by systematically avoiding taxes and labor market regulations. 

This brings actors to the scene that want to defend the Swedish social model and therefore put the issue of taxation on top of the agenda. In fact, tax evasion in the gig economy is a far more important topic in Sweden than in any other country, and mainly so but not exclusively among social partners. Qualitatively, we see this mirrored in the fact that the “prime concern” of Unionen, Sweden’s biggest trade union, is not the employment status of gig workers but that labor platforms follow Swedish taxation rules and collective agreements [@Soederqvist.2017; @Thelen.2018]. In what is strong evidence for ideational path-dependence, Unionen has developed a “Nordic approach to regulating labour platforms” that wants to make “collective agreements easier to integrate and more compatible with the platform firms’ software, in essence developing digitalized versions of existing collective agreements” [@Soederqvist.2018, p. 301]. In short, rather than banning digital business models, Unionen wants to make it easier for digital platforms “to be good platforms” [@Soederqvist.2017]. Thus, despite the challenges it poses, even Swedish unions see digitalization more as an opportunity – as something that requires a particular response but can ultimately strengthen the Swedish model as long as one is “proactive in the implementation of the new technology” [@Wallin.2017].
^[This positive, proactive attitude is echoed in Sweden’s corporatist Scandinavian neighbors. In Norway, both unions and employers view automation as fundamental to maintaining the country’s labor market and welfare model (Lloyd and Payne 2019, p. 217) while the Danish union 3F was one of the first to sign a collective agreement with the cleaning service digital platform Hilfr.]


```{r eval = FALSE}

udpipe_annotated_full <- full_join(udpipe_annotated, full_corpus, by = "doc_id")%>%
  mutate(token = tolower(token))



#first define the extract_rake function so that it handles multiple inputs

extract_rake <- function(x){
 names(x) <- keywords_rake(x, term = "lemma", group = "doc_id",
                            relevant = x$upos %in% c("NOUN", "ADJ"))
}

#then split the dataframe by country and discourse and apply the extract_rake function
#to each dataframe in turn; lastly, bind the list of dfs together by country and discourse

rake_country <-
  split(
    udpipe_annotated_full,
    list(
      udpipe_annotated_full$country,
      udpipe_annotated_full$discourse
    )
  ) %>%
  lapply(extract_rake) %>%
  bind_rows(.id = "country_discourse")%>%
  mutate(country = word(country_discourse,1,sep = "\\."),
         discourse = word(country_discourse, 2, sep = "\\."),
         method = "rake")



#same for textrank


extract_textrank <- function(x){
  names(x) <- textrank_keywords(x$lemma, relevant = x$upos %in% c("NOUN", "ADJ"),
                                ngram_max = 8, sep = " ", p = 1/20)
}

extract_from_pagerank <- function(x){
  as.data.frame(x$pagerank$vector, row.names = rownames(x$pagerank$vector))
}

extract_rownames <- function(x){
  rownames_to_column(x, var = "keyword")
}

textrank_country <- split(
    udpipe_annotated_full,
    list(
      udpipe_annotated_full$country,
      udpipe_annotated_full$discourse
    )
  ) %>%
  lapply(extract_textrank)%>%
  lapply(extract_from_pagerank)%>%
  lapply(extract_rownames)%>%
  bind_rows(.id = "country_discourse")%>%
  mutate(country = word(country_discourse,1,sep = "\\."),
         discourse = word(country_discourse, 2, sep = "\\."),
         method = "textrank")





#finally, "simple" co-occurence based metrics
#several options, for example skipgram based
#here, how often do words follow one anonther even
#if we would skip three words in between


cooccurrence_skip <- function(x){
  names(x) <- cooccurrence(
    x = tolower(x$lemma),
    relevant = x$upos %in% c("NOUN", "ADJ"),
    skipgram = 3
  )
}

coocur_skip <- split(
    udpipe_annotated_full,
    list(
      udpipe_annotated_full$country,
      udpipe_annotated_full$discourse
    )
  ) %>%
  lapply(cooccurrence_skip)%>%
  data.table::rbindlist(idcol =  "country_discourse")%>%
  mutate(country = word(country_discourse,1,sep = "\\."),
         discourse = word(country_discourse, 2, sep = "\\."),
         method = "coocur_skip")


#or we can look at coocurrence in a sentence

cooccurrence_sent <- function(x){
  names(x) <- cooccurrence(
    x = subset(x, upos %in% c("NOUN", "ADJ")),
    term = "lemma",
    group = c("doc_id", "sentence_id")
  )
}

coocur_sent <- split(
    udpipe_annotated_full,
    list(
      udpipe_annotated_full$country,
      udpipe_annotated_full$discourse
    )
  ) %>%
  lapply(cooccurrence_sent)%>%
  data.table::rbindlist(idcol =  "country_discourse")%>%
  mutate(country = word(country_discourse,1,sep = "\\."),
         discourse = word(country_discourse, 2, sep = "\\."),
         method = "coocur_sent")





```


```{r}

#plotting and just some basic filters (black is communicative, grey coordinative)




rake <- rake_country %>%
  filter(!str_detect(keyword, paste(
    c(
      "per",
      "time",
      "article",
      "paragraph",
      "Title",
      "date",
      "such",
      "other",
      "content",
      "original",
      "reserved",
      "many",
      "new",
      "one",
      "csc",
      "Csc",
      "use",
      "group",
      "document",
      "original",
      "content",
      "author",
      "type",
      "title",
      "pl",
      "text",
      "actor",
      "full",
      "publication",
      "blog",
      "entry",
      "last",
      "year"
    ),
    collapse = "|"
  ))) %>%
  group_by(country, discourse) %>%
  top_n(100, freq) %>%
  top_n(8, rake) %>%
  mutate(rake = scales::rescale(rake, to= c(1, 5)))%>%
  ggplot(aes(
    label = keyword,
    size = rake,
    color = discourse
  )) +
  ggwordcloud::geom_text_wordcloud_area(shape = "circle") +
  facet_wrap( ~ country, ncol = 4) +
  scale_color_manual(values = c("black", "dark grey")) +
 theme_minimal(base_size = 20)




coocur_skip_plot <- coocur_skip %>%
  unite(bigram, term1, term2, sep = " ") %>%
  filter(!str_detect(bigram, paste(
    c(
      "per",
      "time",
      "article",
      "paragraph",
      "Title",
      "date",
      "such",
      "other",
      "content",
      "original",
      "reserved",
      "many",
      "new",
      "one",
      "csc",
      "Csc",
      "use",
      "group",
      "document",
      "original",
      "content",
      "author",
      "type",
      "title",
      "pl",
      "text",
      "actor",
      "full",
      "publication",
      "blog",
      "entry",
      "last",
      "year",
      "journal",
      "classification"
    ),
    collapse = "|"
  ))) %>%
  group_by(country, discourse) %>%
  top_n(8, cooc) %>%
  mutate(cooc = scales::rescale(cooc, to= c(3, 6)))%>%
  ggplot(aes(
    label = bigram,
    size = cooc,
    color = discourse
  )) +
  ggwordcloud::geom_text_wordcloud_area(shape = "circle") +
  facet_wrap( ~ country, ncol = 4) +
  scale_color_manual(values = c("black", "dark grey")) +
  theme_minimal(base_size = 20)




coocur_sent_plot <- coocur_sent %>%
  unite(bigram, term1, term2, sep = " ") %>%
  filter(!str_detect(bigram, paste(
    c(
      "per",
      "time",
      "article",
      "paragraph",
      "Title",
      "date",
      "such",
      "more",
      "other",
      "content",
      "original",
      "reserved",
      "many",
      "csc",
      "Csc",
      "use",
      "group",
      "document",
      "number",
      "page",
      "original",
      "content",
      "author",
      "type",
      "title",
      "pl",
      "text",
      "actor",
      "full",
      "publication",
      "blog",
      "entry",
      "last",
      "year",
      "support"
    ),
    collapse = "|"
  ))) %>%
  group_by(country, discourse) %>%
  top_n(8, cooc) %>%
  mutate(cooc = scales::rescale(cooc, to= c(4, 6)))%>%
  ggplot(aes(
    label = bigram,
    size = cooc,
    color = discourse
  )) +
  ggwordcloud::geom_text_wordcloud_area(shape = "circle") +
  facet_wrap( ~ country, ncol = 4) +
  scale_color_manual(values = c("black", "dark grey")) +
 theme_minimal(base_size = 20)


```





```{r keywords, fig.cap="Keywords across countries, with most important keywords for the communicative (black) and coordinative (grey) discourses. Subfigure A depicts the words or phrases with the highest RAKE score across countries. Subfigure B depicts bigrams that occurred most often within a skipgram of size 3. Subfigure C depicts the bigrams that occurred most often within a sentence across countries.", fig.width=14, fig.height=17}

#now let*s patch it together


rake / coocur_sent_plot / coocur_skip_plot +
  plot_annotation(tag_levels = 'A')+
 theme_minimal(base_size = 20)
```

In Germany, the newest wave of digitalization has brought “deep and transformational changes” [@Diessner.2020, p. 10] to the country’s dominant manufacturing sector, which has sparked an intense debate about its future. This debate, however, was and is not about abandoning manufacturing but about defending it through focusing on the “digital transformation of products and production within the traditional industrial core” [@Thelen.2019, p. 295]. We see this discursive shift reflected in the centrality of digital manufacturing in the German discourse, which comprises topics such industry 4.0, smart factories, or cloud computing. What explains this “ongoing active adaption” [@Thelen.2019, p. 302] to more knowledge-intensive types of manufacturing is the sectorial organization of German producer groups and the dominance of its manufacturing sector therein, which put digital manufacturing high on the agenda pushed for higher investments in education and R&D to support this adaption [@Thelen.2019, pp. 300–304].

It is striking to see that across social groups, the challenges posed by digitalization have not been met with protective defensiveness but with a rather proactive willingness to meet them head-on. Central political actors have used their discursive agency to frame digitalization not as something that should be cushioned by compensatory policies but as something that can and should be actively shaped. The SPD-led labor ministry, for example, started a big debate on the future of ‘good work’ with its influential white paper ‘Work 4.0’, which served as a discursive focal point. Rather than being overtaken by events, the ministry actively initiated a debate on what ‘good work’ could look like in the digital age. Moreover, it systematically involved social partners in coming up with answers. This helped shift the debate into issues that social partners could live with or find common ground on, such as flexible working time, training, or data protection. We see this reflected in the keywords on data protection, work time, and further training as well as in the importance of the skills and education frame package. ^[We also this reflected in a topic that is specifically on work councils, collective agreements, data protection, and flexible working hours.]

Contrary to their conservative reputation, German unions, too, have “opted to go on the offensive and adopt a strategy aimed at securing active participation in shaping change, as opposed to rejecting it and then fighting over the consequences” [@Haipeter.2020, p. 242]. They have also concentrated on the above-mentioned issues. This allowed them to have a say in shaping digitalization rather than just slowing it down or compensating its losers. They have chiefly done so through work councils and workplace-level agreements, which is quite remarkable given that work councils were not always so proactive about technological change [@Haipeter.2020, p. 247]. Germany’s corporatist institutions thus channel the German debate in ways that are related to but cannot be derived from the particular challenges the country’s manufacturing-heavy and export-oriented growth model faces. At the same time, political actors use the corporatist institutional environment to push issue onto the agenda that allow them to have a say in how digital technologies are used, while often doing so in ways that break with institutional path-dependencies.

Institutions also shape the terms on which digitalization is discussed in the UK, where there is a wide-spread perception – further bolstered by combative unions – that digital platforms threaten to put an additional strain on already highly flexible labor markets. We can see this in the many references to gig work, self-employment, zero-hour contracts, or minimum wages. We also see it in the importance of topics about the legal and economic status of platform workers, which, nota bene, is particularly prevalent in communicative discourses. In a climate dominated by fears of a further erosion of worker’s rights and the unequal effects of automation on the labor market, even the conservative government had to concede that certain minimum standard needed to be upheld. But it also emphasized the importance of defending “the UK’s position as one of the best places in the world to do business” [@UKGovernment.2018b] by continuing the business-friendly tradition of the ‘British way’. This has led to a fairly conflictual discourse in which concerns over the regulation of labor platforms (e.g., over the regulation of Uber in London) are layered on top of a wider conflict over the nature and merits of this ‘British way’.

Tellingly, topics that are about the threat of automation – either as destroying jobs or increasing inequality – are by far the most prominent in the UK and Ireland. At the same time, topics that are about investments in knowledge-based capital, mainly skills but also universities, research, and digital infrastructures, are much less important. These topics figure more prominently in corporatist Sweden and Germany, and they are overwhelmingly an issue in coordinative discourses. In Germany, in addition to the unions’ efforts to put further training center stage, education has been a central concern for the ministry for labor and employment. In fact, the ministry has even toyed with rebranding itself as the ministry for labor and qualification and introducing a right to lifelong learning (interviewee DE-GOV1). In Sweden, Unionen sees digitalization as an important opportunity to mobilize people around the issue of skill formation: “For a trade union movement that has spent decades trying to convince legislators to invest in lifelong learning, the challenge of digitalization has finally pushed the issue higher up the agenda” [@Soederqvist.2018, p. 298]. Such supply-side investments also found “ready allies” [@Thelen.2019, p. 305] among Sweden’s most influential business groups [cf. @Ornston.2012].

This underscores the point that corporatist institutions create more future-oriented discourses by allowing actors to collaboratively focus on positive-sum responses to digitalization while mitigating fears of automation [@Hicks.1998]. In the UK and Ireland, such corporatist institutions are much weaker. Especially in Ireland, but also in the UK, there is a debate about digital industrial policy, i.e., government measures to support the competitiveness of domestic companies in the digital age. But this debate is precisely not about collaborative investments in knowledge-based capital but about how the government can support domestic businesses through venture funds, taxation, or other developmental tools [for Ireland, see @Brazys.2017]. Overall, we thus find a rather polarized discourse, where governmental actors try to defend the status quo – shoring up the underlying coalition by making smaller concessions – while other actors use digitalization to expose broader problems and push for broader changes, trying to build new coalitions with a potentially responsive public. 



```{r eval = FALSE}
# estimate effect with group, modified functions and internal stm functions, see also https://github.com/bstewart/stm/issues/200


estimateEffectDEV <-
  function (formula,
            stmobj,
            metadata = NULL,
            uncertainty = c("Global",
                            "Local", "None"),
            group = FALSE,
            documents = NULL,
            nsims = 25,
            prior = NULL)
  {
    origcall <- match.call()
    thetatype <- match.arg(uncertainty)
    if (thetatype == "None")
      nsims <- 1
    if (!is.null(documents)) {
      args <- asSTMCorpus(documents, data = metadata)
      documents <- args$documents
      metadata <- args$data
    }
    if (!inherits(formula, "formula"))
      stop("formula must be a formula object.")
    if (!is.null(metadata) & !is.data.frame(metadata))
      metadata <- as.data.frame(metadata)
    termobj <- terms(formula, data = metadata)
    if (attr(termobj, "response") == 1) {
      response <- as.character(formula)[2]
      if (group == TRUE) {
        grouped_topics <- trimws(strsplit(response, "&")[[1]])
        K <- 1:length(grouped_topics)
      } else {
        K <- eval(parse(text = response))
        if (!(posint(K) && max(K) <= stmobj$settings$dim$K))
          stop(
            "Topics specified as response in formula must be a set of positive integers equal to or less than the number of topics in the model."
          )
      }
      formula <- as.formula(as.character(formula)[c(1, 3)])
      termobj <- terms(formula, data = metadata)
    } else {
      K <- 1:stmobj$settings$dim$K
    }
    mf <- model.frame(termobj, data = metadata)
    xmat <- model.matrix(termobj, data = metadata)
    varlist <- all.vars(termobj)
    if (!is.null(metadata)) {
      data <- metadata[, varlist, drop = FALSE]
    }
    else {
      templist <- list()
      for (i in 1:length(varlist)) {
        templist[[i]] <- get(varlist[i])
      }
      data <- data.frame(templist)
      names(data) <- varlist
      rm(templist)
    }
    metadata <- data
    rm(data)
    if (!is.null(prior)) {
      if (!is.matrix(prior)) {
        prior <- diag(prior, nrow = ncol(xmat))
      }
      if (ncol(prior) != ncol(xmat))
        stop("number of columns in prior does not match columns in design matrix")
      prior.pseudo <- chol(prior)
      xmat <- rbind(xmat, prior.pseudo)
    }
    qx <- qr(xmat)
    if (qx$rank < ncol(xmat)) {
      prior <- diag(1e-05, nrow = ncol(xmat))
      prior.pseudo <- chol(prior)
      xmat <- rbind(xmat, prior.pseudo)
      qx <- qr(xmat)
      warning(
        "Covariate matrix is singular.  See the details of ?estimateEffect() for some common causes.\n             Adding a small prior 1e-5 for numerical stability."
      )
    }
    storage <- vector(mode = "list", length = length(K))
    K_grouped <- c()
    for (i in 1:nsims) {
      if (thetatype == "None")
        thetasims <- stmobj$theta
      else {
        thetasims <- thetaPosterior(stmobj,
                                    nsims = 1,
                                    type = thetatype,
                                    documents = documents)
        thetasims <- do.call(rbind, thetasims)
      }
      for (k in K) {
        if (group == TRUE) {
          topics_to_group <- eval(parse(text = grouped_topics[k]))
          grouped_thetasims <-
            apply(thetasims[, topics_to_group], 1, sum)
          lm.mod <- qr.lm(grouped_thetasims, qx)
        } else {
          lm.mod <- qr.lm(thetasims[, k], qx)
        }
        storage[[which(k == K)]][[i]] <- summary.qr.lm(lm.mod)
        if (group == TRUE & i == 1)
          K_grouped[k] <-
          paste0(c(k, ": ", paste0(topics_to_group, collapse = "+")), collapse = "")
      }
    }
    toreturn <-
      list(
        parameters = storage,
        topics = K_grouped,
        call = origcall,
        uncertainty = thetatype,
        formula = formula,
        data = metadata,
        modelframe = mf,
        varlist = varlist
      )
    class(toreturn) <- "estimateEffect"
    return(toreturn)
  }


qr.lm <- function(y, qx) {
  if (length(y) != nrow(qx$qr)) {
    #probably don't match because of a prior
    if (length(y) != (nrow(qx$qr) - ncol(qx$qr)))
      stop("number of covariate observations does not match number of docs")
    #if it passes this check its the prior. thus
    y <- c(y, rep(0, ncol(qx$qr)))
  }
  beta <- solve.qr(qx, y)
  residuals <- qr.resid(qx, y)
  fitted.values <- qr.fitted(qx, y)
  df.residual <- length(fitted.values) - qx$rank
  out <- list(
    coefficients = beta,
    residuals = residuals,
    fitted.values = fitted.values,
    df.residual = df.residual,
    rank = qx$rank,
    qr = qx
  )
  out
}
#this function rewrites the summary.lm() function
# to calculate from our reduced regression
summary.qr.lm <- function (object) {
  z <- object
  p <- z$rank
  rdf <- z$df.residual
  
  Qr <- object$qr
  n <- nrow(Qr$qr)
  p1 <- 1L:p
  r <- z$residuals
  f <- z$fitted.values
  
  mss <-
    ifelse(attr(z$terms, "intercept"), sum((f - mean(f)) ^ 2), sum(f ^ 2))
  rss <- sum(r ^ 2)
  
  resvar <- rss / rdf
  R <- chol2inv(Qr$qr[p1, p1, drop = FALSE])
  se <- sqrt(diag(R) * resvar)
  est <- z$coefficients[Qr$pivot[p1]]
  sigma <- sqrt(resvar)
  list(est = est, vcov = (sigma ^ 2 * R))
}

print.summary.estimateEffect <-
  function(x,
           digits = max(3L, getOption("digits") - 3L),
           signif.stars = getOption("show.signif.stars"),
           ...) {
    cat("\nCall:\n",
        paste(deparse(x$call), sep = "\n", collapse = "\n"),
        "\n\n",
        sep = "")
    
    for (i in 1:length(x$tables)) {
      cat(sprintf("\nTopic %s:\n", x$topics[i]))
      cat("\nCoefficients:\n")
      coefs <- x$tables[[i]]
      stats::printCoefmat(
        coefs,
        digits = digits,
        signif.stars = signif.stars,
        na.print = "NA",
        ...
      )
      cat("\n")
    }
    invisible(x)
  }


is.wholenumber <- function(x, tol = .Machine$double.eps ^ 0.5) {
  abs(x - round(x)) < tol
}

posint <- function(x) {
  all(is.wholenumber(x)) & all(x > 0)
}

nonnegint <- function(x) {
  all(is.wholenumber(x)) & all(x >= 0)
}

extract.estimateEffect <-
  function (x,
            covariate,
            model = NULL,
            topics = x$topics,
            method = "pointestimate",
            cov.value1 = NULL,
            cov.value2 = NULL,
            moderator = NULL,
            moderator.value = NULL,
            npoints = 100,
            nsims = 100,
            ci.level = 0.95,
            custom.labels = NULL,
            labeltype = "numbers",
            n = 7,
            frexw = 0.5)
  {
    cthis <- stm:::produce_cmatrix(
      prep = x,
      covariate = covariate,
      method = method,
      cov.value1 = cov.value1,
      cov.value2 = cov.value2,
      moderator = moderator,
      moderator.value = moderator.value
    )
    simbetas <-
      stm:::simBetas(parameters = x$parameters, nsims = nsims)
    uvals <- cthis$cdata[[covariate]]
    offset <- (1 - ci.level) / 2
    labels <-
      stm:::createLabels(
        labeltype = labeltype,
        covariate = covariate,
        method = method,
        cdata = cthis$cdata,
        cov.value1 = cov.value1,
        cov.value2 = cov.value2,
        model = model,
        n = n,
        topics = x$topics,
        custom.labels = custom.labels,
        frexw = frexw
      )
    out <- lapply(topics, function(i) {
      sims <- cthis$cmatrix %*% t(simbetas[[which(x$topics ==
                                                    i)]])
      if (method == "difference") {
        diff <- sims[1,] - sims[2,]
        out_inner <- data.frame(
          method = method,
          topic = i,
          covariate = covariate,
          covariate.value = paste0(cov.value1,
                                   "-", cov.value2),
          estimate = mean(diff),
          std.error = sd(diff),
          ci.level = ci.level,
          ci.lower = quantile(diff,
                              offset),
          ci.upper = quantile(diff, 1 - offset),
          label = labels[which(x$topics == i)]
        )
      }
      else {
        #browser()
        out_inner <- data.frame(
          method = method,
          topic = i,
          covariate = covariate,
          covariate.value = uvals,
          estimate = rowMeans(sims),
          std.error = sqrt(apply(sims,
                                 1, stats::var)),
          ci.level = ci.level,
          ci.lower = apply(sims,
                           1, quantile, probs = offset),
          ci.upper = apply(sims,
                           1, quantile, probs = (1 - offset)),
          label = labels[which(x$topics ==
                                 i)]
        )
        out_inner["tval"] <-
          out_inner["estimate"] / out_inner["std.error"]
        rdf <- nrow(x$data) - length(out_inner["estimate"])
        out_inner["p"] <-
          2 * stats::pt(abs(out_inner[["tval"]]), rdf, lower.tail = FALSE)
      }
      if (!is.null(moderator)) {
        out_inner$moderator <- moderator
        out_inner$moderator.value <- moderator.value
      }
      rownames(out_inner) <- NULL
      return(out_inner)
    })
    out <- do.call("rbind", out)
    return(out)
  }
```


```{r eval=FALSE}
topic_estimates_country <-
  estimateEffectDEV(
    c(2, 22, 30, 34, 41, 54, 58) ~ country,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "country", type = "pointestimate")%>%
  mutate(topics = "industrial_policy")%>%
  rbind(estimateEffectDEV(
    c(4, 11, 13, 45, 51) ~ country,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "country", type = "pointestimate")%>%
  mutate(topics = "digital_manufacturing"))%>%
  rbind(estimateEffectDEV(
    c(16, 20, 24, 36, 40, 49, 50, 58) ~ country,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "country", type = "pointestimate")%>%
    mutate(topics = "investments"))%>%
  rbind(estimateEffectDEV(
    c(56, 57) ~ country,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "country", type = "pointestimate")%>%
    mutate(topics = "taxation"))%>%
  rbind(estimateEffectDEV(
    c(3, 9, 21, 25, 44) ~ country,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "country", type = "pointestimate")%>%
    mutate(topics = "status"))%>%
  rbind(estimateEffectDEV(
    c(7,17, 19, 28, 33, 43, 59) ~ country,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "country", type = "pointestimate")%>%
    mutate(topics = "automation"))


# now for discourse variable


topic_estimates_discourse <-
  estimateEffectDEV(
    c(2, 22, 30, 34, 41, 54, 58) ~ discourse,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
  get_effects(variable = "discourse", type = "pointestimate")%>%
  mutate(topics = "industrial_policy")%>%
  rbind(estimateEffectDEV(
    c(4, 11, 13, 45, 51) ~ discourse,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
    get_effects(variable = "discourse", type = "pointestimate")%>%
    mutate(topics = "digital_manufacturing"))%>%
  rbind(estimateEffectDEV(
    c(16, 20, 24, 36, 40, 49, 50, 58) ~ discourse,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
    get_effects(variable = "discourse", type = "pointestimate")%>%
    mutate(topics = "investments"))%>%
  rbind(estimateEffectDEV(
    c(56, 57) ~ discourse,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
    get_effects(variable = "discourse", type = "pointestimate")%>%
    mutate(topics = "taxation"))%>%
  rbind(estimateEffectDEV(
    c(3, 9, 21, 25, 44) ~ discourse,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
    get_effects(variable = "discourse", type = "pointestimate")%>%
    mutate(topics = "status"))%>%
  rbind(estimateEffectDEV(
    c(7,17, 19, 28, 33, 43, 59) ~ discourse,
    stmobj = model.stm,
    metadata = stm_input$meta,
    uncertainty = "Global",
    group = TRUE
  )%>%
    get_effects(variable = "discourse", type = "pointestimate")%>%
    mutate(topics = "automation"))


topic_estimates_full <- topic_estimates_discourse%>%
  select(value, proportion, topics)%>%
  pivot_wider(names_from = value, values_from = proportion)%>%
  mutate(ratio = coordinative/communicative,
         dominance = factor(ifelse(ratio > 1, 1, 0)))%>%
  right_join(topic_estimates_country)
```


```{r topicmodel, fig.cap= "Estimated effect of country variable on the prevalence of topic clusters. Color gradients indicate the ratio of the estimated effect of the discourse type variable, with red colors representing a higher conditional expectation to find the respective topic packages in coordinative (as opposed to communicative) discourses, and blue colors representing the opposite. Triangles indicate that the effect of the coordinate discourse was stronger than the effect of the communicative discourse, i.e. that the ratio of the two was greater than 1.", out.extra='angle=90',fig.align="center", fig.width=17, fig.height=14}

topic_estimates_full%>%
  mutate(topics = fct_reorder(topics, -ratio),
         topics = recode(topics, "taxation" = "Taxation",
                         "industrial_policy" = "Digital Industrial Policy",
                         "investments" = "Knowledge Investments",
                         "status" = "Platform Worker Status",
                         "digital_manufacturing" = "Digital Manufacturing",
                         "automation" = "Automation & Compensation"))%>%
  ggplot(aes(reorder_within(value, proportion,  topics), proportion, color = ratio, shape = dominance))+
  geom_pointrange(aes(ymin = lower, ymax = upper), size = 1.4)+
  coord_flip()+
  scale_x_reordered()+
  facet_wrap(~ topics, scales = "free_y")+
  theme_minimal(base_size = 25)+
  scale_color_gradient(low="blue", high="red")+
  labs(x = "",
       y= "")+
  theme(legend.position = "none")

```

Unsurprisingly, public initiatives are a major topic in France as well, where the state traditionally plays an important role in steering economic transformations [cf. @Trumbull.2004]. The national plan on Artificial Intelligence by the Hollande administration is one example of this, Macron’s presidency’s ambition to transform France into a ‘start-up nation’ another. Relatedly, France has an intense debate on gig work. The 2016 Loi Travail introduced specific legislation aimed at protecting platform workers. There is, however, also a lot of conflict over what the gig economy is. The very term ‘collaborative economy’, which is mainly used by the government, is itself contested as it one-sidedly highlights the positive dimension of gig work. This linguistic difference mirrors broader conflicts over digitalization. Unions, platform activists, and the National Digital Council, for example, have criticized the Loi Travail for relying on the social responsibility of digital platforms thereby ruling out labor law solutions (interviewees FR-EXP2/TU1, FR-GOV1, FR-PA1). We see this conflict reflected in the intense debates about the status of platform workers. Thus, not unlike in the UK, the government’s ambition to make France a model digital nation clashes with broader concerns about the distributional inequities of the digital economy (interviewee FR-EXP1).

The discourse in Poland is even more contentious, due to highly combative struggles between Uber and taxi groups which have come to dominate the country’s debate on gig work. Different actors – even within the government – hold widely different views on Uber, with some viewing it as an innovative company and arguing for liberalization while others depicting it as a law-breaker and questioning not only its legality but also its legitimacy [@Serafin.2019]. Due to the lack of a cohesive strategy by social partners and unions in particular, these conflicts have often taken a Luddite turn culminating in physical attacks on Uber cars and drivers. The other big issue is the impact of artificial intelligence – the by far most important keyword – on the Polish economy. On the one hand, Poland is a potential digital challenger with a relatively large ICT talent pool, relatively high-quality digital infrastructure, and relatively mild legacy technology lock-ins [@McKinsey.2018]. On the other hand, Poland strongly relies on sectors at risk of being further automated, from resource extraction to transport to ancillary industries [@Skora.2018]. Despite a number of initiatives to speed up the adoption of new technologies, there is no inclusive plan for how to respond to digitalization, with unions focusing on more tangible bread-and-butter issues [@Skora.2018, p. 465] and many employers not knowing how to incorporate digital technologies into their business model or production processes [@Prokop.2018]. As we have seen, this institutional inability to pull together manifests itself in a much more negative coordinative discourse among social partners, and in the prevalence of threatening and contentious keywords and topics.

Similar to Poland, the Spanish discourse is also one of ambivalence about the effects of the digital transformation, which is seen as both a threat to a country long plagued by economic difficulties and inequalities and as an “opportunity for change” [@Accenture.2017, p. 7]. Importantly, however, both the Spanish government and social partners have taken on a more active role in trying to make sure that the latter view becomes reality. Quantitatively, this is reflected in the important role that topics around government support for digitalization play in the Spanish discourse. Qualitatively, it shows itself in a plethora of initiatives such as the Digital Agenda for Spain (2013), the Agenda for Strengthening the Industrial Sector in Spain (2014), the Connected Industry 4.0 Initiative (2015), and the National AI Strategy (2019). Employers have been supportive of such policy initiatives while stressing the need for enhanced labor market flexibility to harness the potential of digitalization as well as identifying skill shortages as the major obstacle to a successful digital transformation [@Confederacion.2018]. Conversely, unions explicitly recognize the potential benefits of digital technologies but warn against their implications for an already strongly segmented labor market [@Comisiones.2016].

While governmental initiatives point to a generally positive but somewhat unilateral discourse, Spanish unions in particular have also pushed for more social dialogue around digitalization (interviewee ESP_EXP1). For example, the Connected Industry 4.0 resulted from a state-led open consultation process in which unions took part actively while also criticizing it as too ‘soft’ and not going far enough. Moreover, COO and UGT – the industrial union federations – and the Alliance for the Competitiveness of the Spanish Industry signed the Declaration of social partners in 2016, urging the development of a state pact for industry. Likewise, social partners have promoted the ‘Manifesto for the Leadership of Digital Transformation in the Spanish Economy through Talent Development’, containing proposals on training and education to succeed in the digital transformation. These deliberate attempts to seek social partner collaboration and government support indicate a push to move the discourse from a more unilateral into a proactive discourse.

Similar to the Spanish discourse, the Italian discourse focuses a lot on the various ways in which Italian companies can compete or be more competitive in a global digital economy. The 2016 ‘Calenda Plan’ on Industry 4.0, which foresaw significant financial incentives for firms that decided to invest in digital technologies, is one example. And we also see this reflected in the importance of digital industrial policy topics in Italian discourse. Similar to Germany, there is a large debate on Italian companies can adapt to the digital transformation of manufacturing. Unlike in Germany, however, there is no systematic social partner dialogue about how this transformation can be shaped in a proactive and inclusive manner, initiatives like the CGIL’s Progetto Lavoro 4.0 notwithstanding. Reflecting this lack of a corporatist tradition, the focus is on how the government can help Italian companies survive digitalization, the Calenda Plan being a prominent example.^[One thing that our analysis does only partly pick up on, and this is true for both Italy and Spain, is the contested debates on the status of gig workers. We do find that Topic 38, on the collective representation of workers, is most prominent in these countries, but topics on the status of platform workers are not as prominent as in the UK. In both Italy and Spain - especially in the latter case - much regulation came from court rulings. But political actors have actively pushed the issue of platform work on the agenda, which is only partly reflected in our analysis. In Spain, Podemos has presented digital platforms as predatory capitalists that flourish at the expense of ‘left-behind’ workers (interviewee ESP-EXP1. The current government, formed by the Socialist Party and Unidas Podemos alliance, aims at legislating on the matter and Minister of Labor Yolanda Díaz, labor, has started a dialogue with the riders’ collective RidersxDerechos. In Italy, the Five Star Movement has been the most active political formation on gig work regulation (interviewee IT-EXP1). When serving as Minister of Economic Development, Labour and Social Policies, Luigi di Maio called food-delivery riders a ‘symbol of an abandoned generation left with no protection’. After attempts to regulate platform work via social concertation, in November 2019, the so-called ‘Riders decree’ classified riders as self-employed who nonetheless have access to protections typical of dependent work.]

##	Conclusion

There has been much debate as to how platform work and the spread of advanced digital technologies will change the nature of work. In this paper, we have taken a step back and looked at these debates themselves. We have argued that shaping these debates is an essential part of the coalitional work [@Emmenegger.2021] that goes into maintaining or changing institutions. And have found that discourses on the digital future of work are indeed quite different across countries, both in sentiment and content, as dominant social coalitions attempt to frame digitalization in ways that shore up existing institutional arrangements. After all, how digitalization is construed in discourse shapes which political responses are seen as cognitively plausible and normatively desirable. Different problem definitions create different policy imperatives – things that need to be done in response to digitalization – and therefore narrow or broaden the policy solution space [cf. @Hay.2002]. For example, if platform work is viewed primarily as an issue of tax avoidance, what is to be done about it will fundamentally be different than if it is viewed as an issue of worker exploitation [cf. @Thelen.2018].

But digitalization discourses are more than institutional reflexes. Actors can reframe debates in order to challenge or reform existing institutional arrangements. An example for this is when German unions departed from their institutional path and took on a more active role in shaping technological change. They did so by shifting the discourse to issues in which they had a good chance of having a say in, such as data protection or flexible working times.
By taking such a discursive and comparative perspective on digitalization, we have advanced the literature on digitalization in three main ways. First, we have demonstrated empirically that digitalization discourses differ systematically. Mapping such discursive differences helps us better understand how institutions shape the way novel problems are assimilated, but also how actors can use their discursive agency to depart from institutional paths. Second, we have taken up the criticism of paired comparisons [@Locke.1995] and given it a discursive-institutionalist spin. We have argued that different responses to digitalization cannot be understood as different responses to the same problem. Rather, we stressed the importance of discursive problem construction, and this is discursive work is a key part of the coalitional work that goes into maintaining or changing institutions. It is through such discursive processes that global challenges are translated into a series of local problems, which are what countries subsequently ‘respond to’. Third, we have demonstrated how novel methods of quantitative text analysis can be used and combined in a comparative framework to capture sentiment and content of national discourses. This opens up new avenues for comparative research, be it with the intention to generalize findings across contexts or, conversely, to use comparative findings as a starting point for more detailed case studies of how discursive features translate into concrete policy decisions.

Despite these contributions, our study also suffers from two main shortcomings, which future research should remedy. First, it remains agnostic when and under what conditions actors are able to escape their institutional constraints and move discourses in a new direction. Understanding these conditions requires both individual case studies that inquire into the motivations of such discursive entrepreneurs, and more explanatory analyses of the institutional or discursive determinants of such agency [on this, see @Emmenegger.2021]. Second, while our study is a successful proof of concept and therefore broader in its focus, this comes at the price of thinner descriptions and somewhat sweeping explanations of discursive differences and changes. In certain respects, therefore, a more detailed look at, say, the employment status of gig workers or the contestation of delivery platforms would have yielded richer results. These shortcomings notwithstanding, our study has shed new light on old questions about the role of ideas and discourse in comparative political economy and opened up what we see as promising avenues for comparative political research.

\newpage

## Appendix: Interview Table


```{r}




data.frame (
  first_column = c("FR",
                   "FR",
                   "FR",
                   "FR",
                   "IT",
                   "ESP",
                   "DE"),
  second_column = c("GOV1",
                    "PA1",
                    "EXP1",
                    "EXP2/TU1",
                    "EXP1",
                    "EXP1",
                    "GOV1"),
  third_column = c("Policymaker",
                   "Platform activist",
                   "Expert",
                   "Expert/Trade Unionist",
                   "Expert",
                   "Expert",
                   "Policymaker"),
  fourth_column = c(
    "National Digital Council",
    "President and Coordinator
Active member, Collective Autonone de Livreurs de Paris (CLAP)",
"Labour Sociologist (Université Paris Dauphine-PSL)",
"Economist, Insitut de Recherches Economiques et Sociales (IRES)",
"Labour lawyer, IE Law School",
"Labour sociologist, Malaga University",
"Affiliate of a Federal German Ministry"),
fifth_column = c(
  "28.02.2020",
  "21.02.2020",
  "11.02.2020",
  "17.02.2020",
  "31.03.2020",
  "10.04.2020",
  "01.10.2019"),
sixth_column = c(
  "Paris",
  "Paris",
  "Paris",
  "Paris",
  "Online",
  "Written Interview",
  "Berlin"
)
)%>%
  rename("Country" = first_column,
         "Interview Code" = second_column,
         "Interview Category" = third_column,
         "Interviewee Role" = fourth_column,
         "Interview Date" = fifth_column,
         "Place of Interview" = sixth_column,
         )%>%
  kable(caption = "Interview Table", booktabs = TRUE, linesep = "\\addlinespace") %>%
  kable_styling(latex_options = c("scale_down", "hold_position"))



```





\newpage


\pagenumbering{roman}



# Appendix


## A Corpus Collection{#AppendixA}

### A.1 Communicative Discourse{#AppendixA1}


The communicative discourse consists of `r nrow(full_corpus%>%filter(discourse == "communicative"))` newspaper articles collected from `r length(unique(full_corpus$newspaper))` newspapers via Factiva and NexisUni (see Table \autoref{tab:TableApp1} for an overview). We have articles from most important quality newspapers across the political spectrum. We could not obtain articles from Frankfurter Allgemeine Zeitung and Libération in particular, but we do have other center-right and center-left newspapers from Germany and France. To be part of our sample, articles had to contain at least one reference to the 

gig economy **OR** (automation/robotization/artificial intelligence) **AND** (job **OR** jobs **OR** work) **OR** fourth industrial revolution **OR** industry 4.0.



The specific search strings for the non-english-speaking countries were as follows: 





*France*: [gig economy **OR** uberisation] **OR** [[travail or emploi] **AND** [robotisation **OR** automatisation **OR** numérisation **OR** Intelligence Artificielle]] **OR** [quatrième* révolutio* industriell* **OR** Industrie 4.0 ]

*Germany*: gig economy **OR** [[arbeit or arbeitspl* ] **AND** [automatisierung **OR** robot* **OR** künstliche* intelligenz]] **OR** [viert* industr* revolution **OR** Industrie 4.0]

*Italy*: gig economy **OR** [lavoro **AND** [intelligenza artificiale **OR** automazione **OR** robotizzazione]] **OR** [Industria 4.0 **OR** Impresa 4.0 **OR** Quarta rivoluzione industriale]

*Poland*: gig economy **OR** [ [prac* **OR** zatrudnieni* ] **AND** [automatyzacj* **OR** robotyzacj* **OR** sztuczn* inteligencj* ]] **OR** [przemysł 4.0 **OR** platform* przemysłu przyszłości **OR** Czwart* rewolucj* technologic*]

*Spain*: gig economy **OR** [trabajo **AND** [automatización **OR** robotización **OR** inteligencia artificial]] **OR** [Industria 4.0 **OR** cuarta revolución industrial]

*Sweden*: [gig-ekonomi **OR** gig-jobb **OR** gig economy] **OR** [[jobb or arbete] **AND** [automation **OR** automatisering **OR** robot* **OR** artificiell intelligens]] **OR** [Industry 4.0 **OR** industri 4.0 **OR**  fjärde industriella revolutionen]


To make it more likely that articles were really about these topics and did not just contain a single mention somewhere in an otherwise unrelated text, these search strings had to appear in the headline or the lead paragraph of articles. 
The choice of search strings was meant to ensure that the discourse on the digital future of work is represented in its entirety. In countries where gig economy is uncommon and did not yield many results, we included equivalent language-specific terms such as ubérisation in France. For each country, we tried different combinations of search strings and manually checked whether they work, i.e.: do they result in a number of articles comparable, given the country’s size, to other countries? Do they return articles that cover what we are interested in? 

Another potential problem is that the term industry 4.0 is relatively specific (but not exclusive) to some countries (Germany, Italy). We therefore also included the term fourth industrial revolution (in addition to robotization and automation), which should ensure that a higher proportion of industry reference really is due to the fact that these countries talk more about industrial issues – and not due to the fact that there is a terminological bias in our sample. A final problem is that the term gig economy is used more broadly in the UK (and Ireland), and not just referring to digital labor platforms. We do want to capture when gig work and digital gig work are discussed together, but we do not want articles that just talk about gig work in ways that articles in other countries would talk about precarious work. To remedy this, we removed articles that did not contain at least one reference to specifically digital aspects of the gig economy (such as Uber, digital platform, etc.). We also skimmed over all articles and manually removed those that were still not really related to our topic of interest. In a last step, we removed very long (>30000 characters) and very short (<200 characters) articles. All in all, our goals was to make the articles included in our sample as relevant as possible. This means much less noise in our data than had we simply tried to maximize the number of articles based on relatively general search strings. 



```{r TableApp1, warning=FALSE}

number_newspapers <- full_corpus%>%
  count(newspaper = newspaper,
        Country = country,
        newspaper_leaning = newspaper_leaning)%>%
  filter(!is.na(newspaper))%>%
  arrange(Country, newspaper_leaning, desc(n))%>%
  rename(Newspaper = newspaper,
         "Newspaper Leaning" = newspaper_leaning,
         "Number of Articles" = n)


#now just filter it through and group by country

number_newspapers%>%
  select(-Country)%>%
  knitr::kable(longtable = T, booktabs = T, caption = "Newspaper Corpus Overview")%>%
  pack_rows(index = table(number_newspapers$Country))%>%
  kable_styling(latex_options = c("repeat_header"))


```


### A.2 Coordinative Discourse{#AppendixA2}


Our coordinative discourse consists of `r nrow(full_corpus%>%filter(discourse == "coordinative"))` documents (see Table \@ref(tab:TableApp2) for an overview). To enter our corpus, documents had to directly deal with either digitalization of production processes (automation, robotization, Industry 4.0) or new, digitally-enabled forms of work (platform economy, gig work). While the bulk of documents are standalone, some of them are the result of splitting apart longer documents with several sub-chapters. The documents were published between 2012 and 2019 (see Figure \@ref(fig:documentsperyear) for an overview).

Documents were manually collected from the websites of policy actors. We focused on the major social partners, namely governments, employer organizations, and trade unions. The government category includes relevant ministries such as those charged with innovation, work, technology, or social policy. Generally, we selected employer organizations that are part of Business Europe. But since our goal is to obtain documents from the most representative policy actors in a country, we also used – when available – qualitative data from DIRESOC Project, whose country reports provide important information about the importance of specific social partners. When an organization did not belong to Business Europe, but was mentioned by DIRESOC country reports, we included it. We also gave centrality to representativeness when selecting trade unions. 

We chose unions that are part of the European Trade Union Confederation (ETUC). Following the same logic as in the case of employer organizations, we triangulated this criterion with DIRESOC country reports. In addition, if actors were considered relevant based on country-specific knowledge but were not part of our sample so far, we still included them as in the case of the German IGMetall or the British IWGB. Due to linguistic barriers, we asked to native speakers to collect policy documents on Poland and Sweden. We asked them to follow the guidelines described above.



```{r TableApp2}

number_policypapers <- full_corpus%>%
  filter(discourse== "coordinative")%>%
  mutate(actor = recode(actor, "BMVI" = "BMWi"))%>%
  count(Actor = actor,
        Country = country,
        actor_type = actor_type_pol)%>%
  arrange(Country, Actor, desc(n))%>%
  rename("Actor Type" = actor_type,
         "Number of Documents" = n)


#now just filter it through and group by country

number_policypapers%>%
  select(-Country)%>%
  knitr::kable(longtable = T, booktabs = T, caption = "Policy Documents Corpus Overview (Note that documents are of unequal length).")%>%
  pack_rows(index = table(number_policypapers$Country))%>%
  kable_styling(latex_options = c("repeat_header"))

```


```{r documentsperyear, fig.width=9, fig.height=6, fig.cap="Number of Documents per Year (Note that documents are of unequal length)."}

full_corpus%>%
  filter(discourse== "coordinative")%>%
  count(Country = country,
        Year = year)%>%
  ggplot(aes(x = Year, y = n))+
  geom_bar(stat = "identity")+
  facet_wrap(~Country, scales = "free", ncol = 2)+
  labs(x = "", y = "Number of Articles")+
  theme_minimal(base_size = 16)


```



## B. Details on Methods{#AppendixB}

### B.1 Sentiment Analysis{#AppendixB1}


In the paper, we use the Lexicoder Sentiment Dictionary developed by @Young.2012. While the dictionary was specifically designed for political text and is therefore be appropriate for our corpora, we cross-validated our findings with other dictionaries given the validity issues associated with dictionary-based analysis [@Boukes.2020; @vanAtteveldt.2021]. For these dictionaries, we complemented the dictionary-based approach to sentiment analysis with natural language process in order to allow us to account for negators, amplifiers and deamplifiers. We used standard negators, amplifiers and deamplifiers obtained from the lexicon package [@lexicon]. Specifically, we used the following four widely used and relatively general dictionaries to cross-validate our findings:

-- the AFINN dictionary developed by [@FinnArupNielsen.2011]; 

-- the Bing sentiment lexicon developed by @Hu.2004; 

-- the NRC Word-Emotion Association Lexicon developed by @Mohammad.2010; and

-- the syuzhet dictionary (and accompanying R package) developed by Matthew Jockers and the Nebraska Literary Lab [@Jockers.2017].

In case of the NRC dictionary, we did not use their emotion-based dictionaries (such as those for anger, fear, or hope) but only those for positive and negative terms. The afinn and syuzhet dictionaries have a higher resolution than bing and nrc by scoring words not just as negative (-1) and positive (+1) but allowing more gradation. We transformed these higher-resolution scales to a binary positive-negative score for both technical reasons and to provide more robust estimates. After all, whether a word is positive or negative is a much more straightforward question than whether a positive word is quite (+3), very (+4) or extremely (+5) positive, especially across different contexts and for machine-translated documents. 

The strong similarities across dictionaries make us confident that the differences we measure are real differences and not driven by the particularities of any one of these dictionaries (see Figure 4). This is particularly true for the larger differences, i.e., the bottom and top of the distribution, on which we focus in the paper (we don’t, for example, substantively discuss the small differences between Germany, France and Spain). 

Figure 5 shows the 50 most frequently matched positive and negative words for the different dictionaries. This is meant to both illustrate what positive and negative tone mean and to validate the dictionaries. As is evident from the plot, the most commonly matched words are what one would expect to appear in positive and negative framings of the digital future of work. 





```{r sentimentplotappendix, fig.cap= "Discursive sentiment across countries, dictionaries and discourse types with 95 \\% bootstrapped confidence intervals (R = 10000)", fig.align="center", fig.height=21, fig.width=16}



sentiment_score_countries_boot %>%
  mutate(sentiment = Mean,
       upper = Bca.upper,
       lower = Bca.lower)%>%
  group_by(method)%>%
  mutate(country = reorder_within(x = country, by = sentiment, within =  list(discourse, method)))%>%
  mutate(discourse = as.character(
    glue("{discourse}<br><span> discourse")
  ))%>%
  ggplot(aes(
    country,
    sentiment,
    fill = discourse
  ))+
  scale_x_reordered() +
  geom_bar(stat = "identity", position = "dodge") +
  geom_errorbar(aes(ymin = lower, ymax = upper))+
  facet_wrap(~  method+ discourse, scales = "free", ncol = 2)+
  theme_minimal(base_size = 20)+
  coord_flip() +
  labs(x = "",
       y = "") +
  scale_fill_grey()+
  theme(
    strip.background=element_rect( color=NA),
    strip.text=element_markdown(size = 12, lineheight = 1.1),
    legend.position = "none"
  )


  
```



\newpage


```{r posnegwords, out.extra='angle=90', fig.width=18, fig.height=15, fig.cap="Wordclouds with the most commonly matched negative and positive words"}
poswords <- sentiment_score_countries%>%
  select(terms_positive)%>%
  separate_rows(terms_positive, sep = ",")%>%
  group_by_all() %>% 
  summarise(count = n())%>%
  top_n( 50)%>%
  mutate(category = "Positive_Words")%>%
  rename("terms"  = terms_positive)


  

negwords <- sentiment_score_countries%>%
  select(terms_negative)%>%
  separate_rows(terms_negative, sep = ",")%>%
  group_by_all() %>% 
  summarise(count = n())%>%
  top_n( 50)%>%
  mutate(category = "Negative_Words")%>%
  rename("terms"  = terms_negative)



posnegwords <- rbind(poswords, negwords)


posnegwords%>%
 ggplot(aes(
    label = terms,
    size = count,
    color = category
  )) +
  ggwordcloud::geom_text_wordcloud_area(shape = "circle") +
  scale_size_area(max_size = 20) +
  facet_wrap(~category, scales = "free")+
  theme_minimal(base_size = 26)

```
 
 
\newpage

### B.2 Keyword Extraction Techniques{#AppendixB2}


#### RAKE

The RAKE – or rapid automatic keyword extraction – algorithm starts from the idea that keywords usually contain several informative words bur rarely punctuation or stopwords [@Rose.2010]. It thus first tokenizes a given text, using spaces and punctuation to break it at word delimiters. It then creates sequences of contagious words, so called candidate keywords. For example, the short text “robots and artificial intelligence will change the nature of work and our work life balance” will be tokenized as follows: 

[“robots”, “and”, “artificial”, “intelligence”, “will”, “change”, “the”, “nature”, “of”, “work”, “and”, “our”, “work”, “life”, “balance”]

Reading from left to right, the algorithm then creates candidate keywords every time a common stopword is encountered, like this

[“robots”, “artificial intelligence”, “change”, “nature”, “work”, “work life balance”]

Next, a score is created using the following formula:

$$wordscore = \frac{degree(word)} {frequency(word)}$$

Frequency refers to the number of times a word appears in the list of candidate keywords.


$frequency(robots) = 1,$

$frequency(artificial) = 1,$

$frequency(intelligence) = 1,$

$frequency(change) = 1,$

$frequency(nature) = 1,$

$frequency(work) = 2,$

$frequency(life) = 1,$

$frequency(balance) = 1$

Degree refers to how frequently a word co-occurs with other candidate keywords in a given text. This is equivalent to the number of times a word occurs in the candidate keywords that contain this word (a higher word degree can therefore also indicate that it appears in longer candidate keywords): 

$frequency(robots) = 1,$

$frequency(artificial) = 2,$

$frequency(intelligence) = 2,$

$frequency(change) = 1,$

$frequency(nature) = 1,$

$frequency(work) = 4,$

$frequency(life) = 3,$

$frequency(balance) = 3$

As we saw, the word score is proportional to the degree of word and inversely proportional to its frequency. RAKE thus favor words that occur not too frequently but often in combination with other keywords, especially long ones. To calculate the candidate keyword score, we add the word scores of its constituent parts and take a the highest-scoring percent (e.g. the highest-scoring 33%) as our keywords to be extracted. For our example, this would look as follows:

$score(robots) = 1/1 = 1,$

$score(artificial intelligence) = (word_score(artificial) = 2/1 = 2 + word_score(intelligence) = 2/1 = 2)  = 4$

$score(change) = 1/1 = 1,$

$score(nature) = 1/1 = 1,$

$score(work) = 4/2 = 2,$

$score(work life balance) = (word_score(work) = 4/2 = 2 + word_score(life) = 3/1 = 3  + word_score(balance) = 3/1 = 3) = 8$

This means that “work life balance” and “artificial intelligence” were selected as our most central keywords. Rake was implemented using the UDPipe R package (Straka and Straková, 2017).

#### Co-occurrences

We also constructed bigrams based on their number of co-occurrences, either within a skipgram of size four or within a sentence. In the former case (reported in the paper), we counted bigrams when words followed one another directly or when we skipped up to three words in between. In the latter case (reported here), we counted bigrams when they occurred within the same sentence. The results are largely similar to those based on skipgrams, although produce somewhat more sensible results since the sentence restrictions is less sensible as the skipgram-context restrictions (as the latter is narrower). 


#### Textrank

Due to space constraints, we did not include Textrank-based keywords in the paper. However, as Figure \@ref(textrank) shows, the words with the highest PageRank score support our general findings. Textrank is a graph-based ranking model that identifies keywords by constructing a word network based on whether two words follow one another (or co-occur in a window of N words) [@Mihalcea.2004]. If they do, an edge is created between them, the weight of which depends on how often they follow each other in a given text. Next, the PageRank algorithm is applied to this network to rank words in their order of importance (this is what is reported in Figure \@ref(textrank)). Relevant words that follow one another can then be combined to obtain keywords. Textrank was implemented using the R textrank [@Wijffels.2019].



```{r textrank, fig.cap="Keywords with the highest PageRank score", fig.width=14, fig.height=8}



textrank_country %>%
  filter(!str_detect(keyword, paste(
    c(
      "per",
      "time",
      "such",
      "other",
      "content",
      "original",
      "reserved",
      "many",
      "csc",
      "Csc",
      "use",
      "group",
      "document",
      "original",
      "content",
      "author",
      "type",
      "title",
      "pl",
      "text",
      "actor",
      "full",
      "publication",
      "blog",
      "entry",
      "last",
      "year"
    ),
    collapse = "|"
  ))) %>%
  rename(pagerank =`x$pagerank$vector`)%>%
  group_by(country, discourse) %>%
  top_n(8, pagerank) %>%
  mutate(rake = scales::rescale(pagerank, to= c(1, 5)))%>%
  ggplot(aes(
    label = keyword,
    size = pagerank,
    color = discourse
  )) +
  ggwordcloud::geom_text_wordcloud_area() +
  scale_size_area(max_size = 20) +
  facet_wrap( ~ country, ncol = 4) +
  scale_color_manual(values = c("black", "dark grey")) +
  theme_minimal(base_size = 20)


```


### B.3 Word Vectors{#AppendixB3}

In addition to the analysis presented in the paper, we also use word vectors to identify semantic similarities among words and to assess whether they systematically differ across countries for key terms of interest. Word vectors are based on the idea that words that appear near each other have similar meanings. Or, in John Rupert Firth famous phrase, we ‘know a word by the company it keeps’ [@Spirling.2019]. Words are mapped to a multidimensional vector that represents its ‘meaning’, with the different dimensions representing different semantic or syntactic connotations of a word. Somewhat unorthodoxly, we used simple word counts and matrix factorization to calculate word vectors [@Moody.2017]. 

We used a moving slide window to create skipgrams of length eight and then calculated the pointwise mutual information (PMI) metric for all word pairs [see, @Silge.2017]. This gives us information about which words occur together (within a moving window of size 8) more often than expected based on how often they occur on their own. PMI is simply the logarithm of the normalized skipgram probability which in turn is the result of dividing the frequency of two words co-occurring in a skipgram by the frequencies of their individual occurrence. This is a well-understood metric for how frequently two words occur jointly rather than independently [@Moody.2017]. We then cast a sparse matrix where each row represents word 1 and each column word 2 and each value is the PMI calculated above. From there, we reduce the dimensionality of that matrix using singular value decomposition, specifying the number of principal components to 300 – a value common in the word embeddings literature. Using a tidy approach, we now have a tibble of word vectors which we can use to find synonyms (or analogues, etc.). 

Here, we first provide additional examples for this synonym task which demonstrate that our approach reliably finds highly plausible synonyms. As Table \@ref(tab:wordvectors1) shows, our approach works surprisingly well given that it is much less complex and computationally demanding than using neural networks, and given the relatively small size of the data. We can then do the same for terms that are of more theoretical interest. Table \@ref(tab:wordvectors2) depicts a number of such words. Basically, what we do here is to zoom in on words of interest by looking at nearby vectors in a vector space, that is, by looking at synonyms. We see, for example, that in Italy and Germany terms like ‘4.0’ or factory are closely associated with future and work, reflecting the importance for both countries of getting digital manufacturing right. In line with what we found in the paper, in German discourse the future is viewed in more positive terms, with work-life-balance issues taking up a prominent place (time, family, unpaid). The French discourse, to give a second illustrative example, reflects the political commitment to making France a digital frontrunner, and the concomitant entrepreneurial role ascribed to the state in general and the National Digital Council (Conseil National du Numérique) in particular. Accordingly, words like project, program and plan are associated with the future, and words like ambition, national, or public are associated with digital. A final example are the UK and Ireland where work is closely associated with insecurity, reflecting the often-precarious nature of these countries' labor markets.


```{r eval=FALSE}


#the word vector analyis is based on the excellent post by Julia Silge: https://juliasilge.com/blog/word-vectors-take-two/

#first, define slide-window function

slide_windows <- function(tbl, doc_var, window_size) {
  # each word gets a skipgram (window_size words) starting on the first
  # e.g. skipgram 1 starts on word 1, skipgram 2 starts on word 2
  
  each_total <- tbl %>% 
    group_by(!!doc_var) %>% 
    mutate(doc_total = n(),
           each_total = pmin(doc_total, window_size, na.rm = TRUE)) %>%
    pull(each_total)
  
  rle_each <- rle(each_total)
  counts <- rle_each[["lengths"]]
  counts[rle_each$values != window_size] <- 1
  
  # each word get a skipgram window, starting on the first
  # account for documents shorter than window
  id_counts <- rep(rle_each$values, counts)
  window_id <- rep(seq_along(id_counts), id_counts)
  
  
  # within each skipgram, there are window_size many offsets
  indexer <- (seq_along(rle_each[["values"]]) - 1) %>%
    map2(rle_each[["values"]] - 1,
         ~ seq.int(.x, .x + .y)) %>% 
    map2(counts, ~ rep(.x, .y)) %>%
    flatten_int() +
    window_id
  
  tbl[indexer, ] %>%
    bind_cols(tibble(window_id)) %>%
    group_by(window_id) %>%
    filter(n_distinct(!!doc_var) == 1) %>%
    ungroup
}


# next, define some function to calculate pointwie mutual information

custom_pip <-  function(x) {
  x %>%
    mutate(postID = row_number()) %>%
    unnest_tokens(word, text) %>%
    add_count(word) %>%
    filter(n >= 5) %>%
    select(-n)%>%
    slide_windows(quo(postID), 8) %>%
    pairwise_pmi(word, window_id)
}

#then, define function to do singular value decomposition

create_word_vectors <-
  function(x,
           item1 = item1,
           item2 = item2,
           pmi = pmi) {
    widely_svd(x, item1, item2, pmi, nv = 300, maxit = 1000)
  }

# calculate pairwise mutual information for words in skip window

tidy_pmi <- split(full_corpus, full_corpus$country)%>%
  lapply(custom_pip)

# dimensionality reduction

tidy_word_vectors <- tidy_pmi%>%
  lapply(create_word_vectors)

#define function to extract synonomys

nearest_synonyms <- function(x, token) {
  x %>%
    widely(~ . %*% (.[token, ]), sort = TRUE)(item1, dimension, value)%>%
    select(-item2)%>%
    mutate(synonym_of = token)
}


# Here, we use functions and data created in the word vector code chunk in the main text but now we do the analysis not for words of theoretical interest but for a number of common words that allow us to validate our approach

synonyms<- rbind(
  bind_rows(lapply(tidy_word_vectors, nearest_synonyms, "public"), .id = "country"),
  bind_rows(lapply(tidy_word_vectors, nearest_synonyms, "google"), .id = "country"),
  bind_rows(lapply(tidy_word_vectors, nearest_synonyms, "gates"), .id = "country"),
  bind_rows(lapply(tidy_word_vectors, nearest_synonyms, "capital"), .id = "country"))

#again, we clean and plot out data

#we are only interested in the top words, so we select those and also remove stopwords

synonyms_clean <- synonyms%>%
  anti_join(stop_words, by = c("item1" = "word"))%>%
  group_by(country, synonym_of)%>%
  filter(!str_detect(item1, paste(c("http",
                                    "1.*",
                                    ".it",
                                    "27",
                                    "usuarios",
                                    ".fr",
                                    "articoli",
                                    "24",
                                    ".org",
                                    "appendix",
                                    "appendices",
                                    ".eu",
                                    ".com"
                                    
  ), collapse = "|"
  )))%>%
  top_n(15, value)
```


```{r wordvectors1}


synonyms_clean_1%>%
  group_by(country, synonym_of)%>%
  summarize(top_words = paste(item1, collapse = ", "))%>%
  pivot_wider(names_from = synonym_of, values_from = top_words)%>%
  kable(
    caption = "Synonyms for capital, gates, google, and public",
    booktabs = T,
    longtable = T,
    linesep = "\\addlinespace",
  ) %>%
  kable_styling(latex_options = c("repeat_header"), font_size = 8)%>%
  column_spec(1, width = "4em")%>%
  column_spec(2, width = "10.5em")%>%
  column_spec(3, width = "10.5em")%>%
  column_spec(4, width = "10.5em")%>%
  column_spec(5, width = "10.5em")




```



```{r wordvectors2}

synonyms_clean_2%>%
  group_by(country, synonym_of) %>%
  summarize(top_words = paste(item1, collapse = ", ")) %>%
  pivot_wider(names_from = synonym_of, values_from = top_words) %>%
  kable(
    caption = "Word vector similarities for different keywords across countries",
    booktabs = T,
    longtable = T,
    linesep = "\\addlinespace",
  ) %>%
  kable_styling(latex_options = c("repeat_header"), font_size = 8)%>%
  column_spec(1, width = "4em")%>%
  column_spec(2, width = "14em")%>%
  column_spec(3, width = "14em")%>%
  column_spec(4, width = "14em")
```


### B.4 Topic Modelling{#AppendixB4}

#### Preprocessing


For pre-processing, we used annotated part-of-speech tags to select nouns, adjectives, and verbs. We discarded punctuation and stopwords as well as semantically less meaningful parts of speech like determiners or names entities like dates. This seems justifiable, given that we are not interested in linguistic style or subtle word use but rather in the broad thematic contours of discourse. We also discarded location-specific information like capital cities or languages to avoid linguistically (as opposed to substantively induced) country-effects.

We also constructed a list of frequent n-grams such as artificial intelligence, machine learning, virtual reality, big data, tax evasion, further training etc.  This list, which contains 82 n-grams, was manually compiled based on the most frequent collocations identified in the text (with log-frequency biased mutual dependency used as the ordering metric). We see no reason not to include such information as there are obvious theoretical reasons to prefer such n-grams to their separate constitutive unigrams.

We lowercased but did not stem our document feature matrix as the difference between singular and plural forms can be meaningful while the difference between uppercased and lowercased words is most likely not – at least in the types of policy and newspaper documents we are looking at. For example, it can make a difference whether a text speaks of robots in the plural – as in the abstract threat that robots pose (‘the robots will take our jobs’) – and a robot in the singular, which is more likely to be described as something useful or positive (‘the robot does x’). 

We also removed remaining word trash such as html tags, common untranslated words (e.g. della), as well as country-specific information using the named entity information. This latter removal is meant to ensure that differences in topic prevalence are, as much as possible, the result of substantive differences and not of local vernaculars or parochial word usage.

Lastly, we removed words that appeared in more than 50% of documents as such words do not contain much information (e.g. digital). We also removed words that appeared in less than 0.5% of documents. While this is a somewhat arbitrary (although commonly used) standard, qualitative inspection revealed but proofed to be a useful threshold that removed many very specific and rare terms while still retaining un-common but not unimportant words.

#### Number of Topics


We chose a topic model with k = 60 topics. While our decision was assisted by several metrics, the choice was ultimately a theoretical one, based on two criteria. First, given that we are primarily interested in comparing the content of discourse, we want our topics to be broad enough to be at least potentially relevant in different countries, but narrow enough to capture the themes we are interested in (e.g., automation vs compensation). On the one hand, we want obtain topics that are broad enough to be at least potentially relevant in different countries and for different actors. If we chose k=350, for example, we might get many topics that are about particular events in a country (e.g. the introduction of a new technology at a particular company), and will most likely not be discussed in other countries. On the other hand, we want enough topics to allow for meaningful differences to emerge. If we only had, say, 5 topics, these will be too coarse to say anything interesting about cross-country or other differences. Second, while topics are often considered “as an operationalization of policy frames” [@Gilardi.2020, p. 3], topic models easily uncover more sensible topics than there could possibly be frames [@Nicholls.2020, p. 8]. We therefore opted for using a higher number of topics than we would have had we assumed that topics directly capture real-world frames. We then aggregated these topics into “frame packages” [@Nicholls.2020, p. 11] that capture discursive foci that are neither too broad nor too narrow and are therefore theoretically interesting. For example, topics on industry 4.0, the technological transformation of the production process, cloud computing, or smart factories were combined into the frame package 'digital manufacturing', which covers debates on how digitalization is changing industrial production and manufacturing.
 

Based on our intuition about which k should yield topics that are both broad and interesting, we wanted k to be somewhere between 25 and 75. We therefore run topic models with ks between 10 and 100 so as to allow various quantitative metrics to guide our decision. Figure \@ref(fig:storage) plots four metrics – semantic coherence, exclusivity, residuals, and held-out-likelihood – for models with different ks. Semantic coherence is a metric that measures how often the most frequent words in a topic actually co-occur in a document. While semantic coherence has been shown to correlate well with human judgments of topic quality, it has been shown to increase when topics are dominated by very common words [@Roberts.2018]. Exclusivity, by contrast, penalizes models with few dominant top words. It measures the share of top words which are distinct to a given topic, thus creating something of a trade-off with semantic coherence. 

The residuals capture overdispersion of the variance of the multinomial in stm’s data generating process [@Roberts.2018]. Higher values indicate overdispersed residuals, implying that the latent topics cannot account for the overdispersion and more topics may be needed to use up the extra variance. Held-out likelihood estimates the probability that words appear in a document when these words have been removed before the estimation. It is a measure of predictive performance, with higher values indicating better performance. 

Hence, we want semantic coherence, exclusivity, and held-out likelihood to be as high and the residuals to be as low as possible. Topics numbers higher than the number of plausible individual frames on digitalization - of which there can only be so many - are justifiable as we can combine different topics to frame packages [@Nicholls.2020]. In the end, we settled for 60 topics, which the quantitaive metrics supported and which also made sense qualitatively. It has to be said, though, that topics were very similar and stable with 10 or even 15 fewer or more topics.

```{r storage, fig.align = "center", fig.cap="Model diagnostics for different numbers of topics (10 to 100)"}

storage_df <- storage$results %>%
  select(
    K = K,
    `Held-out likelihood` = heldout,
    Residuals = residual,
    `Semantic coherence` = semcoh,
    Exclusivity = exclus,
    `Lower bound` = lbound
  )%>%
  gather(metric, value, `Held-out likelihood`:`Lower bound`)%>%
  mutate(metric = factor(metric, levels = c(
    "Semantic coherence",
    "Exclusivity",
    "Residuals",
    "Held-out likelihood",
    "Lower bound"
  )))


storage_df%>%
  mutate(K = as.numeric(K),
         value = as.numeric(value))%>%
  filter(metric != "Lower bound")%>%
ggplot( aes(x = K, y = value, color = metric)) +
  geom_line(size = 1.5,
            alpha = 0.65,
            show.legend = FALSE) +
  geom_point(aes(shape = metric, size = .8), show.legend = F)+
  facet_wrap(~metric,
             scales = "free",
             ncol = 2
  )+
  labs(x = "Number of Topics",
       y = NULL)+
  scale_color_brewer(palette = "Set1")+
  theme_minimal(base_size = 20)

```


\newpage

### Validation

While topic models are powerful tools “for discovering and exploiting the hidden thematic structure in large archives of text” [@Blei.2012, p. 82] they are no magic bullet and need to be carefully interpreted and validated. Validation requirements are somewhat lower if the main goal is not to measure some pre-specified latent trait but, as is the case here, to explore and usefully summarize texts in order to facilitate comparisons [cf. @Ying.2019, pp. 1–2]. It is nonetheless crucial to at least make this process transparent and to ideally also establish “semantic validity” [@Quinn.2010, p. 216; @Ying.2019, p. 6] by showing that topics are coherent and make sense to external annotators. 

Table 7 shows a complete list of topics and, when applicable, the frame package to which we assigned this topic. We only assigned topics to one of the 6 frame packages presented in the paper, which does not mean that the others could not have been assigned to different frame packages or that other topic-frame-package combinations would not have been possible. The labeling of topics as well as their assignment to frame packages was an interpretative process, based on the most *FR*equent and *EX*clusive Words (FREX) and theoretical reasoning. For this reason, we make the topic terms transparent, and we externally verified the semantic validity of our topics. That is, we checked whether they make sense to human readers and whether they can be semantically distinguished from other topics by asking two external researchers to complete two tasks [@Chang.2009; @Ying.2019]. First, we gave them the list below but instead of only the correct category label, we gave the correct label plus two other randomly chosen labels. The task was to pick the correct label. Second, we gave them a list with the top 4 FREX terms plus the highest FREX term from another randomly selected topic. Their task was to correctly identify the ‘incorrect’ word. In the first task, they, on average, picked the right topic label 85 % of the time; in the second task, they chose the non-fitting word 73,3 % of the time. These results compare well with results from similar tasks [@Ying.2019] and make us confident that our topic model produces semantically valid topics.


\newpage


```{r}

topic_terms <- labelTopics(model.stm, c(1:60), n = 20, frexweight = 0.5)[1:4]%>%
  lapply(as.data.frame)%>%
  lapply(rownames_to_column)%>%
  bind_rows(.id = "type")%>%
  pivot_longer(cols = V1:V20, values_to = "term")%>%
  select(-name)%>%
  rename(topic = rowname)%>%
  filter(type %in% c("frex", "prob"))%>%
  group_by(topic, type)%>%
  summarize(top_words = paste(term, collapse = ", "))%>%
  pivot_wider(names_from = type, values_from = top_words)%>%
  ungroup()%>%
  mutate(topic = as.numeric(topic))%>%
  arrange(topic)



#label the topics:


topic_terms_labelled <- topic_terms %>%
  mutate(
    topic_label = recode(
      topic,
      "1" = "Art",
      "2" = "Digital Government",
      "3" = "Occupational Safety",
      "4" = "Industry 4.0",
      "5" = "Sustainability",
      "6" = "Health Care",
      "7" = "Artificial Intelligence",
      "8" = "Statistics",
      "9" = "Platform Work",
      "10" = "Taxi Regulations",
      "11" = "Cloud Computing",
      "12" = "Entrepreneurship",
      "13" = "Transformation of the Production Process",
      "14" = "Work Councils",
      "15" = "Economic Statistics",
      "16" = "Digital Skills",
      "17" = "Autonomous Vehicles",
      "18" = "Other",
      "19" = "Robots",
      "20" = "Creative Skills",
      "21" = "Independent Platform Work",
      "22" = "Competitivness Reforms",
      "23" = "Human Resources",
      "24" = "Higher Education",
      "25" = "Gig Work",
      "26" = "Multimedia",
      "27" = "Other",
      "28" = "Automation",
      "29" = "Sharing Economy",
      "30" = "Investment Incentives",
      "31" = "Digital Future",
      "32" = "EU Agenda",
      "33" = "Labor Market Inequality",
      "34" = "SME Support",
      "35" = "Business News",
      "36" = "Digital Infrastructure",
      "37" = "Municipalities",
      "38" = "Industrial Relations",
      "39" = "Cyber Attacks & Data breaches",
      "40" = "Further Training",
      "41" = "Business Support",
      "42" = "Data Protection & Internet Regulation",
      "43" = "Automation",
      "44" = "Gig Worker Rights",
      "45" = "Digital Manufacturing",
      "46" = "Business Strategy",
      "47" = "Exports",
      "48" = "High-level meetings",
      "49" = "Women & STEM",
      "50" = "Research & Development",
      "51" = "Smart Factory",
      "52" = "(False) Self-Employment",
      "53" = "Elections",
      "54" = "Industrial Policy",
      "55" = "Competition",
      "56" = "Taxation",
      "57" = "Tax Evasion",
      "58" = "Digital Competences",
      "59" = "Compensation",
      "60" = "Other",
    )
  )


# assign frame packages

topic_terms_labelled_category <- topic_terms_labelled %>%
  mutate(Category = ifelse(
    topic %in% c(16, 20, 24, 36, 40, 49, 50, 58),
    "Digital Investments",
    ifelse(
      topic %in% c(2, 22, 30, 34, 41, 54, 58),
      "Digital Industrial Policy",
      ifelse(
        topic %in% c(4, 11, 13, 45, 51),
        "Digital Manufacturing",
        ifelse(
          topic %in% c(7,17, 19, 28, 33, 43, 59),
          "Automation & Compensation",
          ifelse(
            topic %in% c(56, 57),
            "Taxation",
            ifelse(
              topic %in% c(3, 9, 21, 25, 44),
              "Status Platform Workers",
                     "/")
        )
      )
    )
  )))


#print selected topics for table in paper

topic_terms_labelled_category%>%
  select(-prob)%>% 
  arrange(topic)%>%
  kable(
    caption = "Complete List of Topics and Topic Categories",
    booktabs = T,
    longtable = T,
    linesep = "\\addlinespace",
    col.names = c(
    "Topic",
    "Top FREX Words",
    "Topic Label",
    "Aggregated Topic Category"
  )
  ) %>%
  kable_styling(latex_options = c("repeat_header"), font_size = 8)%>%
  column_spec(1, width = "2em")%>%
  column_spec(2, width = "34em")%>%
  column_spec(3, width = "7em")%>%
  column_spec(4, width = "7em")


```

