dataesr/scientific-paragraphs-categorization huggingface dataset:
Automated text analysis can be used to discover new patterns and structures in the political texts, as well as to verify how known covariates affect these patterns. We use structural topic modeling to identify specific migration-related topics in the dataset and to understand the differences in issue salience and policy framing between the parties. The chapter is structured as follows. Section 1 outlines the relevant theoretical literature and introduces hypotheses. Section 2 summarizes research design, data, and methods. Section 3 presents our results and discusses the implications. Section 4 summarizes findings and real-world implications of this work and discusses future avenues we see as viable and helpful in this research realm.
First, Englishspeaking Canada and the USA face many of the same policy issues. Second, both legislatures publish detailed transcripts of debates in English. For the United States analysis, we use  Gentzkow et al. (2018)  Congressional Record for the 43rd-114th Congresses: Parsed Speeches and Phrase Counts data, which captures all floor debates from the United States House of Representatives. We subset the data to include only the House of Representatives' speeches from Winter 1994 to Fall 2016. For the Canadian analysis, we collected debates from the House of Commons from  Beelen et al. (2017). We use the OpenParliament. ca PostgreSQL dump provided by  Beelen et al. (ibid) , which covers speeches from 1994 and trim the US data accordingly. Similarly, we remove speeches in the Canadian data that come after 2016, as this would have no counterpart in the US data.
We focus only on the lower houses of the national legislature to maintain comparability across cases. This is necessary as the United States' Senate is an elected body and the Canadian Senate is not. From there, we processed the data into text corpora for analysis. 2 o better characterize differences in rhetoric on the topics of migration and build a comparison between the United States and Canadian political sectors, we divided parties into "liberal" and "conservative" groups. For the USA, this was straightforward with Democrats as the liberal camp and Republicans the conservative. 3,4 However, in Canada, the divide is more complicated. In this paper, when we discuss "conservative" parties in Canada, we are referring to the Conservative (C), Canadian Alliance, Progressive Conservative (PC) and Reform parties.
Dataset Subsetting: Dictionary Approach To identify migration-related speeches and reduce the size of the corpus in initial analyses, we use a dictionary approach to subset the data. The original US dataset has 377,817 Democratic speeches, 374,397 Republican speeches, and 1840 Independent Speeches. The original Canadian dataset has 231,681 Liberal Party speeches and 172,089 Conservative Party speeches, with a combined 71,068 speeches by other conservative parties. 6 For the purposes of investigating the outlined research question and particularly for application in the USA and Canadian context, we take a simple approach to subset the corpora of speeches to include only those that are relevant to migration topics. We use a dictionary approach but limit it to three words: asylum, refugee, and immigration.
Structural topic modeling allows for the assessment of the role of selected covariates on the latent topics detected through topic modeling. To analyze how political camps frame the migration policy in the legislative speeches, we employ structural topic modeling implemented in R (2018) in the stm package  (Roberts et al. 2017 ). As we are interested in understanding how topic prevalence (frequency of topic discussed across speeches) and topic content (how a topic is discussed) are affected by the ideological camp to which the politician belongs, stm is the optimal choice of software for this analysis. The stm package builds on Latent Dirichlet Allocation  (Blei et al. 2003 ) and it also offers the spectral initialization-a non-negative matrix factorization of the word co-occurrence matrix.
Following the literature on spectral decomposition with particularly large datasets (more than 10,000 units in the vocabulary), we opt for this approach  (Roberts et al. 2017). Using the migration-related subset of the parliamentary speeches, we process the data by removing custom and built-in stop words as well as the words that only appear in one document. We also took the standard steps of case lowering, stemming, and removing punctuation to clean our corpus. Moreover, using the advantages of the structural topic modeling approach, we specify the interaction effect of the ideological position of the speaker and the date of the speech as the prevalence covariate and ideological position of the speaker as a content covariate. The prevalence covariate allows us to analyze how the selected attributes from the linked metadata effects the contribution of each topic in the documents.
The content variable provides the ability to consider how the metadata attributes effect which words are prominent in each topic. To shed light on the empirical plausibility of the outlined hypotheses, we proceed to develop two models: one for the speeches in the US House of Representative and the other for the speeches in the Canadian Parliament. Both models were defined to include 20 topics. In selecting the number of topics, we tested several other options-providing either a more nuanced or crude understanding of migration policy and relevant subcomponents outlined in the speeches. While stm package offers a technical solution to determining the most informative number of topics, we instead chose the number based on theoretical underpinning. We opt for 20 topics for two reasons. First, it allows a fairly nuanced overview of topic subcomponents as the literature suggests are being debated along with the core migration issues (e.
Results We divide the results section into four parts. We first outline the 20 topics our model has produced to give readers a better understanding of the data we analyzed. Second, we analyze which migration-related topics can be associated with either of the two ideological camps. Here, we disregard time and focus on the entire dataset. Third, we focus on the changes in topic salience across time for a number of theoretically relevant topics. Fourth, we focus on understanding how parties frame migration policy through the selection of representative keywords from individual speeches. Each of these steps allows for the testing of our hypotheses from a different perspective. For each of the steps, we start with the United States, which we then compare with Canada.
Migration Policy Framing: Word Use In the earlier two subsections, we discussed how the two ideological blocks quantitatively contribute to the migration topics, first by taking the whole dataset into account and then by emphasizing the changes across time. In this subsection, we focus on the results from the perspective of how the two ideological blocks discuss migration policy. We will analyze the choice of the words liberal as opposed to conservative camps uses-providing an in-depth understanding of the framing strategies. Figure  6a , b are visualizations of the word choice comparisons we present in this section. They represent the types of words from the Human Trafficking topic from the United States' and Canadian Speeches, respectively. We provide visualizations for the other topics in the appendix.
The chapter represents a methodological contribution by providing a guide on how automated text analysis and in particular structural topic modeling can be used to study intricate and complex research questions from social sciencessuch as rhetorical conflicts in framing migration policy in legislative speeches. Further extensions of this work should incorporate validation of the findings either through human coding of a part of the selected dataset or through comparison with existing qualitative studies. Expanding the time frame, and therefore incorporating more international conflicts, may clarify the relationship between conflict abroad and policy framing by domestic political elites. We hope this chapter encourages more researchers to use quantitative text analysis to explore social science research puzzles.
For the purpose of modeling normative conflict in social networks with respect to relative group sizes, homophily/heterophily, and group norm differences, we developed a modular simulation framework based on a network generation algorithm using preferential attachment, group size and homophily/heterophily  (Karimi et al. , 2018) , and Granovetter's threshold model  (Granovetter, 1978). We utilized R (R Core Team, 2019) for our model as it appears to be more widespread among the social science community than Python and offers more customizability, better parallelization, and scalability than NetLogo. Consequently, probabilistic processes in our model are implemented using the sample() function in R, which relies on the current system time to generate a seed for pseudo-random number generation.
Data To capture significant similarities and differences in the street protest phenomenon, we deliberately take data from two recent cases of protests from different cultures and political systems: The Iran protests in December 2017 and January 2018 exemplifies a short-term protest that heated up quickly and ended abruptly. In contrast, PEGIDA in Germany since 2014 is a case of long-term motivation of protesters and slow topic shift that can be considered as a social movement. A social movement is a sort of organization with specific goals (Della Porta and Diani 2009, p. 145-150) while a single protest, like the Iran case may not have leaders or definite goals. Protests, in the long run, may turn into a social movement.
Moreover, if what is taking place is in some way related to this form of interdependence, we expect the impact of this additive effect to decay over time. We are not the first to explore how interorganizational relationships are related to armed group behavior. For example,  Asal and Rethemeyer (2008)  and  Phillips (2014)  have looked at how the number of alliances affect group behavior, while others have emphasized on whom the group is connected to, noting that what matters is the quality of the partners and the location of the tie within the overall network  (Horowitz and Potter, 2014). In this paper, we consider all the possible connections between all the groups that are present in a given environment (what in social network language would be a "fully connected network" or a "complete graph") and differentiate between actual ties (groups with a relationship as defined by the Big, Allied, and Dangerous dataset 1 ) and environmental ties (groups simply operating in the same country).
Data and Case Settings The empirical data for our study comes from the Global Terrorism Database (GTD). With information on over 180,000 domestic and international attacks between 1970 and 2017, including kidnappings, assassinations, and bombings, this is the most comprehensive open-source database on terrorist attacks. While including more events than any other available dataset, it rests on clear inclusion/exclusion criteria. It excludes criminal incidents devoid of political or ideological motivations, incidents arising from clashes between opposing armed groups, and incidents perpetrated by the state. In this sense, it allows us to focus specifically on the outcome we are interested in: one-sided violent attacks by NSAGs. 2 n addition, we use data on ties between armed organizations. These data come from Phillips (2015),  3  which is an extension of the Big, Allied, and Dangerous (BAAD) dataset  (Asal and Rethemeyer, 2015).
These ties are manually curated based on the Terrorism Knowledge Database, media reports, and legal documents and represent a variety of known incidents of activity between two groups, such as training another group's members, providing safe harbor, or collaborating on attacks together. 4 In this work, we treat the ties between organizations in an undirected manner (i. e. , groups in the relationships are coded regardless of who is addressing whom). For this exploratory analysis, we use three conflicts as our case studies-Afghanistan, Colombia, and Iraq-and restrict the period to 2001-2005. Multiple armed groups were active in each of these conflicts for the period under study, all executed a considerable number of violent attacks, and at least one actual tie was observed between two of them.
Here, like in Afghanistan, US-led forces were faced with a large-scale insurgency and a number of terrorist organizations targeting the international military presence, civilian population, and aiming to disrupt the ongoing nation-building efforts. For each of these countries, we carefully cleaned the data to make sure it included a meaningful and internally valid set of NSAGs and ties between them. Based on historical records, secondary sources and first-hand knowledge of each of these conflicts, we excluded organizations that we knew were not operating in the same environment and/or were mostly inactive during the time frame under analysis. 5 dditionally, we merged observations when the same organization was coded as two or three different ones given the use of various names in the sources used to build the original dataset.
Analytical Estimation From the empirical data, we analytically estimated possible latent influences from one NSAG's attacks on the timing to another NSAG with a Hawkes process  (Hawkes, 1971). A Hawkes process is a self-exciting point process that takes the form of 7 When combining these two variables, we did not use any weighting as we did not have any theoretical reason to believe that any of the two variables should matter more than the other as proxies of NSAG' capacity to commit an attack. We also considered a large set of variables that provide a good sense of capacity to commit an attack from the Non-State Actors in Armed Conflict Dataset (NSA) compiled by  Cunningham et al. (2013). However, as we found that many of the relevant variables in this dataset were highly correlated for the organizations we were working with, we decided to use weights only from the GTD.
8 All data and code is available at https://github. com/adamrpah/BIGSSS-Terror. λ * g (t) = μ g + j :t g,j <t α g e -β g (t-t g,j ) (1) where μ g is the base rate of "attacking" for a given NSAG; g, α g is the additive effect that a prior attack has; β g is how quickly the additive effect from a prior attack decays; t g,j is how long ago the attack was carried out; and λ * g is the resultant rate for NSAG g at time t. Without the additive term that accounts for the influence of prior attacks on the future attack probability, a Hawkes process reduces to a Poisson process. Empirically λ * g (t) is the attack rate for an individual group during the interval of interest. The mathematical extension of a Hawkes process from a single NSAG reacting to its own past actions (univariate Hawkes) to a NSAG incorporating signals from non-self actors (multivariate Hawkes) is relatively straightforward.
Since there are only two successful combinations in Afghanistan, the interpretation is straightforward: only when groups react, nearly, as much to the actions of other groups as they do to the actions of their allied groups is the empirical data reproduced. Iraq is similar to Afghanistan in so much as there must be a high additive amount to the rate from each attack in order for the simulation to statistically reproduce the empirical data. There is an expected dependence on the strength of environmental ties-as this link becomes stronger the range of permissible α values grows, to the point that nearly half of the parameter combinations are successful when α = 0. 5. The primary difference is that in this case not even a weak dependence on how quickly the impact of prior attacks decays seems to play a role.
The introduction of georeferenced event-level data has been central in this emerging research agenda. Most notably, Raleigh (2012) utilized a time-locationactor-action model using event data from the Armed Conflict Location & Event Data Project (ACLED) and found a lack of co-occurrence of armed conflict events and instances of violence against civilians in time and space. Instead, a pattern of VAC events emerged around areas occupied by several active groups, suggesting that violence against civilians is not, in fact, "a strategy to gain civilian support or punish civilians" but rather a strategy more often used as a means for competition among violent actors  (Raleigh 2012, p. 478). That these results run counter to the prevailing discourse highlights the importance of using event-level data to study the effect of armed conflict occurrence on VAC.
Data and Case Selection To test the method described above, we carry out an in-depth analysis of conflict processes in the Democratic Republic of the Congo (DRC) from 1998 to 2000-a period capturing the earlier portion of the Second Congo War-using data from the Armed Conflict Location and Event Data Project (ACLED)  (Raleigh et al. 2010). ACLED includes spatially-tagged observations of both battle events and instances of violence against civilians. Each observation is coded using press reports from a range of local and national sources. Previous studies into the relationship between conflict and civilian victimization have made similar use of ACLED data  (Raleigh 2012). In the analysis below, we focus our attention on battle events as an independent variable explaining the occurrence of violence against civilians.
First, our simulation strategy assumes that the coders of data on battles and VAC events are correctly assigning those events to their exact locations. When conflict events occur in remote areas, it may be the case that either media sources or dataset coders elect to record the location of those events as a nearby settlement rather than the true coordinates. Normally, such a decision would represent a small amount of measurement error, but, in our framework, it is crucial to modelling outcomes. Since most settlements lie along road networks, the assignment of observations to nearest settlements could inflate the amount of conflict occurring within our road buffer polygons, thus biasing estimates of the true causal effect in these areas. Future approaches may encompass a "hybrid buffer" weighted on the basis on existing settlement.
It is unclear whether this type of error occurs in commonly used event datasets. As  Eck (2012)  has shown, these datasets, when they are created from media sources, tend to be biased towards greater coverage of urban areas in general. The ACLED coding guidelines are fairly robust against coders misassigning observations and the dataset does include a variable indicating the precision of the coordinates  (ACLED 2017, p. 25-26). In future applications, this variable could be used to filter out low-certainty observations. However, these checks at the coder-level would not prevent misreporting by the media sources further upstream (i. e. , non-local, national, and international media). Thus, our approach is not immune from the literature's ongoing concerns about the precision of spatial conflict data.
ACLED collects this data through news from international, regional, and local media reports as well as NGO accounts  (ACLED, 2019). Our full dataset consists of 4654 conflict events in South Sudan from July 14, 2011 through December 10, 2018. We see in Fig. 1  that there are many more conflict events that occur after 2014. Figure  1  also illustrates the event type over time, where most of these events are battles where there is no change in territory and violence against civilians. The counts of each of these event types for the full time period are presented in the legend of Fig. 1. In Fig. 2a , we see the spatial distribution of these 4654 events over the country of South Sudan, where most of the events occur in the middle of the country. Each event has an affiliated transparency, so where there are darker colors in Fig.
2a  and b , that means there are more events occurring at that location. In the ACLED dataset, each day of an event is given a separate row in the dataset. If we count each of the days of a given conflict as separate events, then we have a total of 4654 conflict events as stated earlier. However, if we treat events as the same if they share the same location and description and occur within similar time periods, and then assign the duration as the number of days that the event persists, then we only have 4160 unique events in our dataset. When duration is defined in this way, the duration of an event ranges from 1 day to 24 days. Most events last 1 day with the mean duration being 1. 11 days. In Fig. 2b , we see the duration of these events illustrated by the size of the point. Figure  2b  gives a sense of the spatial distribution of the events that last longer than 1 day.
For the purposes of our analysis, due to the fact that the vast majority (93%) of conflict events only last 1 day and we would like to treat these events to be independent, we take the first day of the given conflict event and assign each event their duration as a covariate. Therefore, our final dataset for modeling purposes consists of 4160 unique events all of which are assigned their duration as a characteristic of the event, which we will analyze in detail later. Through the ACLED dataset, we have two actors that are included with most events. There are no events that are missing the first actor and there are only 192 out of the 4160 events in our final dataset that are missing a second actor, i. e. , where there was only one actor involved. These are exclusively events where there are only rioters or protesters involved in the event.
There may be events with more than two actors involved, but ACLED only provides the first two actors involved. From these 4160 events, we have 285 unique actors in our dataset. We see some of the most commonly occurring actors below in Table  1 , along with their assigned actor type. As mentioned in Sect. 1, it is important to consider the difference in diffusion mechanisms between events that include state and non-state actors as well as civilians/rioters/protesters. To address this difference, we re-code and divide all of the ACLED actors into state actors, non-state actors, and civilians/rioters/protesters. We abbreviate the last category as simply "civilians" going forward. State actors include governments, governmental agencies (e. g. , security department or police department), and the military force formed by a government or ruling party.
In Fig. 3 , we see the estimates of the F function for both the pointwise and simultaneous methods. We see that even for the more conservative method, the simultaneous envelope, we see strong evidence against complete spatial randomness (CSR), as the observed curve is not close to the mean simulated curve under CSR. Therefore, we conclude that spatial modeling is appropriate for our dataset. F ^hi (r) F ^lo (r) Fig. 3  We diagnose the absence of complete spatial randomness (CSR) through the simultaneous and pointwise simulation envelopes, as the observed curve lies outside of the envelope of the simulated curve.
Continuous Space Model Now that we have established that spatial modeling is appropriate, as the data does not follow complete spatial randomness, we start with a simple continuous space model. First, we treat our dataset as an inhomogeneous Poisson Process with an intensity λ(x). We create a kernel density estimate for the intensity λ(x) over space and time  (Rowlingson and Diggle, 1993). First, we plot the estimate of the spatial intensity over the complete time window as well as the estimate for the temporal trend over the full area through a quartic kernel. In Fig. 4a , we see a high estimate for the kernel density estimate in the southern part of the country, as well as a couple of other peaks. In regards to the time dimension in Fig. 4b , the low count of conflict events at the end of the time window is due to lack of data in the last month of the dataset, as the dataset only covers through mid-December.