A recent trend within the realm of political science is the reliance on computational methods to extract frames or ideological perspectives from political text. Frames can be communicated using a particular vocabulary or by the repetition of certain phrases . By strategically framing a discussion, politicians and journalists try to influence the way an audience perceives the discussion at hand. Within parliament, frames often differ across parties, each of which aim to convince voters of their perspective on certain issues. In our research, we singled out immigration as the main topic and investigated what frames exist, how they differ between parties, and how they evolve over time.
Approaches developed within computational linguistics allow us to identify frames through topic modelling . This method treats each document as a mixture of latent topics and tries to recover those topics by identifying covariant terms within the document. The Structural Topic Models (STM) of Lucas et al. take advantage of document-level metadata to better classify and analyze trends between topics . By adding party and date information as metadata, we can examine their effects on the topics created by the STM package.
Using an XML database of parliamentary proceedings from the British House of Commons that covers all the debates in Westminster between 1935 and 2015, we took on two tasks: the addition of party information to the proceedings and, based on the party information added to the XML corpus, the construction of a Structural Topic Model that will allow us to extract the various framing techniques used by left- and right-wing parties in the British House of Commons.
As two distinct tasks were involved in creating the final data, both shall be discussed. First, party metadata was collected from an authority list of British parliamentarians and stored in an associative array. The array stored each parliamentarian’s unique identifier, along with all parties a parliamentarian was affiliated with and the years of membership. Using the associative array, each speech in the proceedings could have its speaker’s party identified using the unique member identifiers tag of the speech. The correct party was determined using the party-membership date boundaries: a member of party A from 1990 to 1993 and party B from 1994 to 1996 would be correctly identified using the year the speech was given. This information was then added to the XML elements that represent speeches, i.e. uninterrupted strings of words.
Once this metadata was added, an unsupervised approach was used to extract frames on the immigration issue. More specifically, we applied the STM package for R to our data, a tool that allows us to study topics in relation to the metadata, i.e. the date and party information added to the parliamentary speeches. As the first step, we selected all speeches containing immigration terms, and represented these texts as a "bag of words" by calculating the frequency of each word. Secondly, we restricted the corpus to only those words that fall within a certain document frequency range, thus excluding tokens that are too general or too rare to be useful. We then generated a number of topics based on the remaining corpus and labelled these topics based on which terms were most meaningful or indicative for the topic at hand, rejecting any remaining topics which lacked meaningful party or date differences.
The effects of party and time on the occurrence of a topic were then estimated. Twentieth-century politics in the UK has been dominated by two parties, Labour and Conservative, which were hence compared for differences in word usage. Following this, debate on each topic was examined over time.
The estimation process successfully yielded examples of topic framing between parties within particular discussions, demonstrating which words were more commonly used by each party. In the final model, of the twenty-three topics used, while topics like immigration’s effects on health care or industry showed no split between Labour and Conservative, nine topics, including racism towards immigrants and immigration of sponsored families, were preferred by Labour. The remaining eight, including immigration’s effects on budgets and urban planning, were preferred by Conservatives. Within particular topics, rhetoric would often be noticeably different: when discussing immigration of sponsored families, words such as "woman," "wife," and "join" were used more often by Labour politicians, while Conservatives preferred words like "citizenship," "settle" and "entitle." An example of these distinctions in context can be found in the included appendix.
Estimation over time was somewhat less successful due to the nature of immigration discussion over time: most immigration debates were concentrated during particular periods characterized by increased immigration legislation, such as during the late sixties and early seventies. Topics that were only discussed at length for a few years simply accompanied historical events that prompted a reaction in British parliament. Cases like this include illegal Jewish immigration to Palestine during the 1930s and 1940s and Hong Kong emigration following the Sino-British Joint Declaration in 1984. Later analysis should be conducted to examine the interaction of speaker party membership and speech date.
The use of framing in parliamentary immigration debate is shown by the notable distinctions between Labour and Conservative discussion of numerous immigration issues, such as families, border control and crime. These topics are connected to broader discussions of "Britishness" and identity within the UK, which continue today in debates on the value of multiculturalism . In this way, the metadata’s substantial effect on the language of immigration debate is preserved by structural topic modelling, allowing us to analyse the effects that party framing strategies exert on the discussion.
As analysis of these findings continues, questions of the interaction between party and time can be examined along with other potential modifications, such as a larger number of topics or a more restricted corpus. Having done so, our findings can then be compared to qualitative efforts within comparative politics, potentially leading to new discoveries in how immigration debate is framed where quantitative results differ from established qualitative solutions. This new methodology provides justification for further studies of political science inspired by the text-as-data approach.
 R. M. Entman. "Framing: Towards Clarification of a Fractured Paradigm," Journal of Communication, vol. 43, no. 4, pp. 51-58, 1993.
 D. M. Blei. "Probabilistic Topic Models," Communications of the ACM, vol. 55, no. 4, pp. 77-84, Apr. 2012.
 C. Lucas, R. Nielsen, M. E. Roberts, B. M. Stewart, A. Storer, D. Tingley. "Computer assisted text analysis for comparative politics," Political Analysis, vol. 23, no. 2, pp. 254-277, 2015.
 A. Heath, N. Demireva. "Has multiculturalism failed in Britain?" Ethnic and Racial Studies, vol. 31, no. 1, pp. 161-180, 2014.
The following are speeches on the issue of husband-wife reunification through immigration. Punctuation was re-added after it was removed by the STM package. Words correlated with the speaker’s party are bolded.
Mr. Raison, Conservative:
"The British Nationality Act created for the first time a status of British citizenship for those who belong most clearly to this country. That citizenship is tightly but fairly drawn; it is distinct, as we all know, from the British Dependent Territories Citizenship and the British Overseas Citizenship, neither of which give the right to live here in general. It is for those who are committed to this country and it is a symbol of our unity in this country. That is why we believe so strongly that the women who hold it should all be on the same footing when it comes to deciding whether they wish to bring a husband to Britain—whether they were born here or not, that is the crucial point in the debate. We have created a British citizenship for those people and the women who hold it must all be in the same position."
Mrs. Slater, Labour:
"A debate like this shows how little we have progressed on the question of the equality of women. Men still regard women almost as chattels. The minister said that the term ‘wife’ rather than ‘spouse’ might protect a wife who had come here, but could not it also protect a husband whose wife might want to come here and land herself if he had a good job? We are looking at it not from that point of view but from the point of view of a woman in my constituency who is doing a fulltime teaching job and doing it very well. Her husband wants to join her – should not the immigration officer be able to protect her, by asking her whether she wants her husband to join her?"