Exploring what words mean

Exploring what words mean

Can we humans truly understand what computers actually think when they are presented with textual information? Master’s in Artificial Intelligence student BRIAN PACE surely hopes so!

Reading a sentence may seem straightforward to us, but there’s a lot that our brains have to take in and process when we do so. Indeed, on top of understanding what the sentence is trying to say, we also have to take into account the context the sentence is in and the feelings the sentence is meant to evoke.

Now imagine when it’s a machine that’s trying to read a sentence and its job is to extract the sentiment – or the feeling – from the said text. Do you just teach it that the words ‘unpleasant’ and ‘horrible’ both infer negative sentiments, even though one is worse than the other? And how would it know that a person had a good experience even though they used the word ‘bad’ in the sentence, such as in, ‘I had previously had a bad experience, but I think the company has come really far and I like it now’?

Well, this is the project Brian Pace is currently working on. And the way he is trying to teach a machine how to decipher the sentiment behind a sentence is through Explainable AI (xAI), which is a set of frameworks that aid those working with them understand and interpret the predictions made by machine learning models.

“While sentiment classification tasks already exist, these are usually based on extracting textual features from the provided data,” Brian explains. “This can be achieved through manual processes, such as annotating words in a sentence as content words or high-frequency words, and then using pattern-matching to detect the correct pragmatic import portrayed by the author.

“What I am trying to do, however, is to get xAI to understand for itself whether a sentence is negative, positive or neutral. To do this, it will analyse the robustness of a machine learning model by removing the most prominent features from the corpus and observing the decline in accuracy, achieved with interpretability analysis.”

To understand this, let’s take the sentence, ‘I love burgers,’ as an example. Through the project, Brian is getting xAI to check how the sentiment of the sentence changes when one specific word is removed. The sentence remains positive both when ‘I’ and ‘burgers’ are removed, but changes sentiment when the word ‘love’ is removed. Therefore, ‘love’ is the qualifier in this situation.

But, in that case, why not just tell the software that ‘love’ infers good sentiment?

“One of the problems with current AI systems is that if two words appear frequently together, then the software will start believing that they are both similar qualifiers,” Brian continues. “So, in other words, if the words ‘love’ and ‘burgers’ appear together often, then the software will classify ‘burgers’ as a positive word, when, in fact, it’s nothing of the sort.

“This doesn’t just happen with words, either. In my thesis, I noticed that the software often assumed the hashtag (#) on Twitter is negative, even if the tweet is a positive one. Thankfully, through this system, the software should now understand what it should truly be looking for.”

What we need to keep in mind at this point is that computers don’t understand words and sentences the way we do, but they are better with numbers. So the process here is to turn words into numbers. To do so, Brian is using four different types of word embedding software, namely FastText, ELMo, GloVe and Word2Vec. Each of these has its own pros: FastText, for example, takes groups of letters into consideration, while ELMo looks at the text and generates word embeddings on the spot.

This software then works with xAI to give qualifiers a ranking, with 0 being totally negative to 1 being totally positive, thus making 0.5 neutral. In this case, ‘bad’ isn’t as bad as ‘horrible’, so ‘bad’ has a ranking of, say, 0.3, while ‘horrible’ has a ranking of 0.1. Thus, the xAI can then actually tell you whether a sentence is negative, positive, neutral and, more importantly, why it has decided so.

“The benefits of this are numerous,” Brian continues. “In the world of words, such software could be used by companies looking to find out what users are saying about their brand or product on social media without the need to have someone doing it manually.

“Nevertheless, such software could also be used for medical purposes by, for example, having the patient inputting symptoms and the xAI accurately telling them what they are suffering from and what medication to take. This, though, requires a lot of precautions and care since the end result will eventually affect the life of a human being, but, in principle, the possibilities are indeed endless.”

How such software will impact us in the future remains to be seen, but there’s no doubt that xAI coupled with well-thought studies that use its full potential could see the way we live change forever.