{'fraction_non_alphanumeric': 0.026164536330102083, 'fraction_numerical': 0.021017414429098397, 'mean_word_length': 4.926537874936451, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
What is new? News media, General Elections, Sentiment, and Named Entities

The repetition of names of persons, places, ideas and events, is used sometimes for emphasis. The same is true of the repetition of affect words - repeated preferentially to show negative/positive sentiment. During an election campaign, this repetition may have a bearing on the electability of politicians and on the reputation of political parties. News media covering an election may be involved in endorsing political parties, attempting to set aspects of election agenda, and may have gender bias. Using Rocksteady, an affect analysis system, we have analyzed samples of news published nationally and regionally by Irish media between 21 st December 2010 and 20 th Feb. 2011 - in the run up to the Irish General Election on 25 th February 2011. Our results show that a diachronic study of the coverage, based on named-entity dictionary crafted from electoral lists and with key financial and economic terms added, supplemented by a General Inquirer type dictionary of affect, helped us to distinguish between the winners (two opposition parties that have subsequently formed a coalition government) from the loser (the incumbent party).


Introduction
Literature on sentiment analysis is boldly going where others will fear to tread: sentiment of large populations within a community is being extracted and aggregated by 'review mining, product reputation analysis, multi-document summarization, and multi-perspective question answering' (Riloff et al., 2006). The fields covered are wide ranging and include sentiment/opinion extraction from film reviews (Namenwirth et al., 2002), from letters to the Editors in major newspapers (Asher et al, 2009), and from politically sensitive documents in multiple languages (Ahmad, 2011).
There is burgeoning literature on the impact of sentiment on financial markets (Daly et al., 2009), where it has been shown that negative sentiment reflects at one time has an impact on prices in the markets subsequently (Tetlock, 2007). The extraction of sentiment in particular and affect in general is a multi-faceted issue; aspects of affect-bearing writing is based on the use of metaphors (Ahmad, 2011).
However, evaluation frameworks on the choice of data, especially who wrote or spoke sentiment bearing documents, are still evolving (Pang & Lee, 2008). As a result, studies on the impact of the articulated affect in general, and sentiment in particular, are limited in the sentiment analysis literature.
The question of data source is important because of the multiple sources of bias that can be introduced at the data production stage: particularly when print/TV/digital news media is changing rapidly with considerable reliance on social media and 'active news gathering' in decline partly because of commercial pressures (Krause, 2011).
Sentiment can be deliberately generated by a news publisher who is keen on focussing a discourse on charismatic personalities or certain topics that will benefit those supported by the publisher (Curtice, 1999;Druckman, 2005). It is equally possible that a news publisher may be pandering to the political, social and economic views of a community to maximise financial gain from selling advertisements in their print/offline publication (Gentzkow, Shapiro, 2010). The affect articulated by an opinionated person or organisation may be rooted in their racial and/or gender bias -both articulated vividly in the 2008 US Presidential Elections (Parks et al., 2008). Such bias has been defined by authors as "a deviation from the informative media function, which may result in a distorting effect on political attitudes and outcome" (Brandenburg, 2005).
A large political science literature is dedicated to such influence of the media on electoral outcomes. One branch focuses on the possible impact of newspapers endorsing a candidate or a political party; this practice is common in the USA, the UK and Canada.
Some scholars have argued that endorsements have a weak impact on electoral outcomes. In an influential study Erikson(1976) studied the impact of 223 newspapers that were defined as local to a given community voting patterns in 200 northern US counties found that while there was a substantial change in endorsements patterns, this did not translate into a significant change in votes cast. Erikson has argued that the estimated effect of 'presidential endorsements treatments' is about 5% or so (Erikson, 1976, pp.215). Curtice (1999) reports an experience similar to that of Erikson's when there was a 'break from homogenous media treatment' in the United Kingdom. Curtice looked at 1,976 voters and asked these voters to name the newspapers out of a sample of 10 papers they read, The author's analysis suggests that the change or otherwise in the voting intentions of his subjects suggests that whilst 'partisan press does have some influence on the way in which their readers vote', it is not clear that the imbalance between readership of pro-party newspapers (Conservative vs Labour) 'over any period of time tends to be small if evident at all ' Curtice, 1999:28).
Contrary to Erikson and Curtis, some recent studies that account for credibility of the source of an endorsement, suggest that newspaper endorsements may have a direct effect on voter choice. Voters are more likely to endorse the candidate of publication but only where the endorsement is credible. For example, endorsements for Democratic candidates from left-leaning newspapers exert less influence that those from neutral or rightleaning newspapers (Chiang & Knight, 2011).
In order to account for the various biases of the various humans and organisations involved in the supply of data used in sentiment analysis, and in the subsequent evaluation of such systems, we draw upon studies in political science, and political and media communications, specifically, the techniques used in the study of general elections where media affect and sentiment and its impact on the outcome of the elections, is the focus. We examine newspaper content for word frequencies that can generate 'bias' in coverage of parties, gender and party agendas in the run-up to the Irish general election 2011. While our study does not draw a causal relationship between bias and electoral outcome, it clearly demonstrates that sentiment analysis must factor in context and bias analysis in order to support a broad field of impact studies.

Media Bias and Perceptions
In this section we present the various types of bias which are the focus of empirical investigation in the literature of political science and political communications. We specifically look at endorsement, coverage, agenda and gender.

Types of Bias and Perceptions
Endorsement: There are different levels of political description when we attempt to discern the impact of media on the outcomes of elections. First, a meta-level political description where we might look at the attitude of publishers towards a political party or party leader as articulated directly in an endorsement during the course of an election campaign. The most common empirical finding is that the impact to be minimal except when a major change on the political scene also takes placeespecially the vote against a government that has been in power for a long period. This is suggested by frequency data on endorsements during the electoral campaigns in the USA (2004,2008), the UK (2005UK ( , 2010 and Canada (2006Canada ( , 2008Canada ( , 2011. In the USA and the UK, there was a change in the government after the elections in 2008 and 2010 respectively; in both cases the incumbent parties were in power for over 8 years. The switch over by newspapers supporting the incumbent over to the opposition that goes on to win the election: In the USA, during the 2008 Democratic Party was endorsed by 70% of the newspapers and won the same percentage of votes: the 'swing' in endorsement was 18% and in votes cast it was 16%. The situation in the UK is similar but differs in a crucial detail: The endorsements for the ruling Labour Party dropped by over 40% in 2010 when compared with the 60% endorsements in the previous elections held in 2005: the drop in Labour's vote was 6% and the opposition Conservative gained 4% in the 2010 elections. The Cana-dian election cycle shows no discernible effect of newspaper endorsement over the last 3 elections: the Conservatives have had an average of 70% endorsement but their share of the vote of the seats in parliament is still just above 50%. The overall message of our observations of the elections in the three countries is that endorsements may have an impact and this is perhaps more pronounced when a change in government is imminent (see Table 1 for details).
It appears that newspapers have a greater impact than TV news broadcast in some cases. This may be due to a number of reasons and here are some reasons that have been reported recently: (a) Panel studies suggest that only 2 in 100 news viewers pay much attention to the news about presidential elections and, in any case, news about elections makes up less than 10% of TV news output (Gentzkow, Shapiro, 2010); but there is some evidence that political advertising on the TV can persuade parts of a populace in exceptional circumstances (Beltrn, 2007). (b) Voters typically follow trusted news sources -so the modality of the medium, visual or linguistic, may not be an issue (Miller & Krosnick, 2000). (c) Partisan coverage, as in Fox News, has an impact in that this coverage tends to nudge the voter away from their original choice of party/candidate; contrarily, some scholars have suggested that 'opinionated news is no more likely to contribute to partisan polarisation than non-opinionated news' (Feldman, 2011:pp178). (d) Politicians on the periphery of the mainstream political systems, depend as much on TV news and interviews as on coverage in the newspapers (Bos et al. , 2011). (e) The coverage of a candidate is usually positive if the candidate discusses issues that relate to his or her party (Hayes, 2008). (f) Both the committed voters and the undecided voters can be influenced by the positive coverage of a party in the media, and the undecideds are influenced more (Hopmann et al., 2010).
Gender: In an experimental study, neuropsychologists (Chiao, et al., 2008) confirmed that gender affects how people perceive and evaluate facial appearance (Keating, 1985) in the context of an election (Little et al., 2006). Gender bias in the media can also perversely serve as an advantage for incumbent female politicians especially in the US House of Representatives (Milyo & Schosberg, 2000). Female incumbents have been shown to be of higher average quality than their male counterparts and this quality is perhaps underestimated by male opponents in an election. The higher quality of the female incumbent, however, may be due to the 'barriers to entry' that women face in joining political institutions. Some early analysis of the 2008 US Presidential election, where race (President Obama's ethnicity) and gender (Senator Clinton's female persona), there is good news to be had in that it appears that US voters are moving away from their stereotypical images of both women and people of colour (Miller & Krosnick, 2000).

Bias in the Irish Context
Returning to the Irish context with which this study is concerned, Brandenburg(2005) has looked at the media coverage Irish General Election of 2002. He studied three biases in the coverage by 4 newspapers and two TV stations namely: first, coverage of political parties; second, the bias shown by the coverage of a given party's actual or contrived expertise in a policy area; and third, the judgemental or evaluative tone of the coverage expressed in terms of positive or negative statements made by a newspaper about individual political parties. Brandenburg analysed 220,180 lines of text and the lines were coded along 12 policy dimensions and five campaign dimensions. He also included the location of the text -whether the text appeared in the editorial columns, on the front page, as a photo caption or in a cartoon. Brandenburg's analysis shows that coverage was higher for incumbent parties and lower for the opposition. Coverage was proportional to the election results of 2002 and very similar to the campaign poll average of the parties involved. Of the 5 major parties in the election, the agenda of only three parties (Fianna Fáil, Fine Gael and Labour) 'find a certain degree of reflection in the media coverage' (Brandenburg, 2005 pp310). The author concludes by noting that whilst the Irish papers were not as openly partisan about a political party yet the papers were 'prone to various forms of bias' (Brandenburg, 2005 pp 318). Specifically, he finds a homogenous anti-politics bias.
Gender bias in the media and its impact on electoral outcome has not been extensively studied in the Irish context. An initial study demonstrates that in the 2002 general election, candidate gender was not a factor affecting voter choice (McElroy & Marsh, 2010

Method and Data
Our data for this study is derived from newspaper content. We focus on samples of news published nationally and regionally by Irish newspapers between 21 st December 2010 and 20 th February 2011in the run up of the 2011 Irish General Election on 21 st February 2011. We set out to investigate the presence of three biases: gender; agenda; and party coverage. We also run an analysis of general affect specifically focused on well-being and power.
The data was extracted using the news aggregator LexisNexis which allows access to news media across Ireland: this data, part of LexisNexis data deluge, has to be curated (Witt et al., 2009). The news is organised in a time series and the content analysed automatically by an affect analysis system Rocksteady developed at Trinity College, Dublin, Ireland.

Data Curation
Criteria A strict search criterion for news data was implemented whereby only articles from Irish publications would be selected and must contain the terms Ireland and Politics, or Ireland and Elections(s) within the headline or opening paragraph.
Media concentration There are 59 titles that are published in Ireland including 6 published in Northern Ireland with total circulation of 1.56 million copies. There are 29 publishers in total and one publisher (Independent Publishing) owns 17 titles with a total audited circulation of 652,000 copies including the highest circulation Irish Independent (138,00 copies). There are 23 publisher with only one title including the 2nd highest circulation Irish Times (102,000 copies) and the Irish Examiner (46,000 copies). Sunday newspapers account for 1/3 of all copies in circulation.
Collection Data was retrieved using the Lexis-Nexis online repository which allows for searches for a wide number of sources based on the criteria laid out above. An initial corpus of 3,024 articles was created covering the time period of 55 days between 21 Dec 2010 and 20 Feb 2011 with a total of 41 sources: 11 nationwide, including the Irish state TV network RTE, and 30 regional newspapers . LexisNexis provides the ability to batch download articles into a single file compris-ing 500 of the returned news items. Once collected data may be sanitised and organised in a consistent manner.
Sanitisation Once data has been collected it is important that any meta data included within the text be removed as it would alter the total word count within the article and provide erroneous results. When dealing with news data a key issue is that of reprints; reprints may occur whereby a regional newspaper re-releases the same item from a national paper or may be due to minor modifications of corrections of the news item, news items may also be expanded over the course of the day. We have developed a system for the identification and possible deletion of duplicate items within a news collection.
The Levenshtein distance algorithm provides a metric of the differences between two texts representing the number of alterations required to change one to the other. While intended for small strings the method may be scaled to examine larger texts. We have found there is as much as 35% of the texts may be duplicated leaving a balance of 65% texts that do not substantially overlap.

Data Analysis
The Rocksteady system uses a combination of general purpose affect dictionaries, like Stone's General Inquirer Dictionary, and an optional domain specific dictionary. The Irish general election dictionary contained candidate names as terms with party affiliation, constituency, party role, qualifications and gender as categories. This resulted in a dictionary with 517 terms and 39 categories. The names of the candidates, party affiliation and constituency where retrieved from www.electionsireland.org.
For general affect analysis we focussed on evaluation (positive/negative), a deference category, words related to power, and one welfare category, well-being. (See Table 2): We have used a frequency count approach and we have not used special purpose algorithms for identifying variants of a proper noun or attempted to resolve pronominal references. Our frequency count focuses on single and compound words and a dictionary look-up informs which of the many categories the words belong to. The categories include: affect (negative/positive, strong/weak); domain specific-categories (election vocabulary, Irish place names that are used as labels for con-Category Instances Evaluation Positive (1915) /Negative (2291) : So-called sentiment words. Deference Power (1266): words indicating the influence to affect the policies of others Welfare Well-being (486): words describing the health and safety of organism:

Coverage: Leaders and Parties
The citations for all leaders shows an increase between week beginning December 27 th 2010 through to the week beginning February 14 th 2011, with some notable changes in the trend. The citations to the leaders (and parties) is partially inflated for Micheál Martin and his party. During the period of study the ruling FF had leadership election which unseated the party leader (Mr Brian Cowen) and Mr Martin was elected after a threeweek contest ending on 26 th January 2011 -after which his citations and that of his party declined and his party lost the elections to the two opposition leaders (Kenny and Gilmore) (See Figure 1 ) Our analysis of citation parties for the parties and leaders shows a good correlation with the results of the 2011 General Election as measured in terms of the first preference votes. The citation patterns in our newspaper corpus shows a progressive better correlation with the first preference votes (FPV) cast over a 7 week period (see Table  3). The FPV appear to be a good measure of real public opinion. There are a number of changes in the correlation between citations to the political parties, including the citations to the independents and minor parties, and the FPV. These changes relate to the leadership challenge within the party of the government (Fianna Fáil) and its outcome -reducing the correlation well below 50%. However, once the 'honeymoon' period of the new leader is over three weeks before the election , we see that

Even handed Coverage?
The discussion in section 2 suggests that news media shows preference for one particular party -indeed Brandenburg(2005) noted that this was the case in the Irish elections in 2002. The party of government, Fianna Fáil (FF), is given greater coverage by all the news papers, the main opposition parties (Fine Gael and Labour) are collectively given greater coverage than is the case for FF, but individually the two parties receive less than 2/3rd of the citations for FF (Figure 2 ).

Agenda Coverage
The 2011 election was followed by a high level visit from the International Monetary Fund and the European Central Bank (ECB) for restructuring the Irish government debt. The severest economic downturn meant that economic terms dominated the discussion in the newspaper. The ECB organised the so-called bail out and can be seen to dominate the discussion (Figure 3)

Gender
There where 517 candidates contesting the election, 448 male candidates and 69 female candidates. The ratio of male to female contestants (6.45), does not generally correspond to the amount of coverage given to male or female candidates -on average male candidates are referred to 8 times more than the women; the best ratio for women-to-men citations is 6.3 and the worst is 10.7 (See Figure 4) These results are not surprising. Due to the high-stakes nature of the election, new female candidates were unlikely to achieve much press in comparison with issue coverage. As dominant players in the parties are male and these dominate issue coverage, a future study will test whether male and female new candidates were allocated equal coverage.  Finally, the 2011 election in Ireland was held in the backdrop of the worst economic crisis in the Republic's history and the incumbent parties' economic wherewithal was under serious criticism. The atmosphere was quite gloomy and the newsmedia carried substantial amount of negative sentiment. We noted a higher positive sentiment which remained constant throughout the campaign -however, positive sentiment has usually little impact as the analysis of financial markets suggests (Daly et al., 2009;Tetlock, 2007). The variation of power words is mild and shows a slight rise in the period when the Fianna Fáil party had its internal election. The distribution of well being words also remained static with a small decline towards the end of the campaign.

Afterword
We have described the work undertaken in political science, political and media communication to show how sentiment analysis is conducted in real world. The impact of sentiment can be seen in the results of political processes such as elections. That affect of certain sentiment, activity and orientation can be deliberately introduced has been noted especially in the context of the concentration of media ownership. Media does tend to set up or influence political agenda and this can distort the reporting of the mood and attitude of the populace in the elections.
We have described how a large sample of newspaper output (43 of the 59 publications within Ireland) collated over two months of an election can be analysed using well known methods used in po- Figure 4: The gender chasm is magnified during the Irish General Election litical opinion analysis. This sample has captured key issues -economic downturn-and has shown that a diachronic generated by the Rocksteady systems was closer to the final observed reality that is the election of Fine Gael and the Labour Party. The gender chasm was there for anybody to see: not only did fewer women contested the election they did not even receive the coverage proportionate to their numbers contesting the election.
We are in the process of analysing sentiment expressed about individual parties and their leaders and conducting a multivariate analysis to validate the descriptive analysis we have presented in this paper. We also intend to look at the results of sanitisation and measure what the impact of deleting duplicate items will be.