Kiwi teen uses AI analysis of social media chatter to capture mood of the nation

With the Government’s second year coming to a close and the 2020 general elections on the horizon, a number of polls, including 1 NEWS’ latest Colmar Brunton poll, have tried to capture the feeling of the nation.

Sentiment analysis of replies to Simon Bridges' tweets on the Politikiwi site. Source: Supplied

But with the growing accessibility of natural language technology powered by machine learning and artificial intelligence, next year’s elections could see some new players.

Independent political insights website Politikiwi started off as a personal project for 19-year-old software engineer Robert Calvert’s portfolio.

Since December 2018, he’s gathered over 58,000 responses from people to tweets by party leaders in Parliament.

He then put each tweet through Microsoft or Google’s natural language processing technology to analyse its sentiment — whether positive or negative towards the MP — based on the quantified emotional connotation of words used in context.

Any number above zero indicates a positive sentiment to varying degrees, and numbers below zero the opposite.

“It [the website] was sort of a way for data to be shown in a user-friendly way and show people how easy it is to gather this information. So it’s actually built for them,” Mr Calvert said.

The technology itself isn’t new, with some businesses already using it to better understand their customers through analysing text from places like social media comments or reviews. Meanwhile, Auckland-based insights agency Zavy tracked the sentiment of social media posts from parties in the 2017 elections.

Mr Calvert said the idea to build his own sentiment tracker came after he saw the emotion behind people’s social media responses during the 2016 US presidential elections.

“Whilst, of course, New Zealand politics doesn’t have the sample sizes which the US politicians do, I was interested to see … whether similar sorts of trends and insights can be gathered,” he said.

“No doubt that the major parties are also gathering this kind of data. So, if this raw data is publicly available to people and the insights which they are gathering about the elections available to them, I think it could really help in making more educated decisions.”

However, he said there were some limitations to the data and its analysis. Mr Calvert said he only analyses people’s replies to politicians on Twitter to be sure about the topic it was tweeting about and the politician it related to.

“There's definitely a selection bias since there's some people who are following this person and are interested in what they have to say,” he said.

“There's a slight bias towards negative in general, because if you agree with something, you're probably just going to like it. But if you disagree with it, you probably have a comment against what they're saying.”

For this reason, he said it was “better to compare politicians to each other, rather than looking at the absolute values”.

How it works

Evan Wilson, the head of data innovation at Kiwi analytics company Qrious, said New Zealanders could be seeing more political trackers next year.

“It’s a topic that will get broad attention and the evolving technology means it’s easier to produce these types of insights,” he said.

Mr Wilson said AI allowed sentiment analysis to be done at scale and close to real time. Developing technology also meant machines could better understand words in different contexts and determine how positive whole bodies of text are.

He said technology developed by the likes of Microsoft and Google can be trained to do this through transfer learning where machines are taught to recognise new texts based on the analysis of large volumes of existing texts.

“It separates the things you’re talking about from the ‘doing words’, to then also looking for the emotional type of words,” Mr Wilson said.

“So you can say the coffee was great, but the service was bad. It is able to recognise coffee as a thing, then ‘was great’, and then be able to associate the great with the coffee.

“A lot of customers we work with are using natural language processing to genuinely understand customer pain points so that they can improve the products and services.”

He said this was also a possibility for politicians.

“As a politician, your job is to represent the community and understand what things the community likes or not about some of the policies you've got potentially.”

However, Mr Wilson said it was important to consider if data sets were representative of the demographics of the voting public as people who felt more positively or more neutral about topics were less likely to post.

“If you're a politician, you can walk around and talk to a whole lot of people and you might get a reasonably fair sample of, of your constituency.

“Whereas if you just rely on say something like social media, you've got to think ‘are the posts a fair representation of everyone in my area?’”