Comparing Machine Learning through BBC News Analysis
Tags: gcp, aws, azure, machinelearning
Published: 2019-07-02 13:29:03

---
title: Comparing Machine Learning through BBC News Analysis
published: true
tags: gcp,aws,azure,machine-learning
canonical_url: https://medium.com/solacedotcom/comparing-machine-learning-through-bbc-news-analysis-84ad9d7b1c94
---

![](https://cdn-images-1.medium.com/max/958/1*WPc5z0dYSx0tkxU54FRHrg.png)<figcaption>Comparing two Cloud-based Machine Learning capabilities: Image Analysis and Sentiment Analysis</figcaption>

Leveraging Machine Learning (or Artificial Intelligence) capabilities for your application is easier than it ever has been. The major cloud computing providers offer these capabilities in an easy to consume manner, so you can start building applications quickly.

However, did you know the actual results across the providers can vary greatly?

I decided to build a demo application that uses two Machine Learning capabilities to analyse BBC News articles and compare results across the big three cloud providers: Amazon’s [AWS](https://aws.amazon.com/), Microsoft’s [Azure](https://azure.microsoft.com/) and Google’s [Cloud Platform](https://cloud.google.com/).

You can try the application yourself [**here**](http://london.solace.com/cloud-analytics/machine-learning.html).

### What is Machine Learning?

[Machine Learning](https://en.wikipedia.org/wiki/Machine_learning) (ML) is a branch of [Artificial Intelligence](https://en.wikipedia.org/wiki/Artificial_intelligence) (AI), although often the terms are used interchangeably. It describes the ability of computers to “ [learn](https://www.sas.com/en_gb/insights/analytics/machine-learning.html)” how to perform an action, without being explicitly told how to do it, as would have been the case for computers in the past. It is unlocking a whole range of new possibilities. I came across [this](https://www.economist.com/news/special-report/21739431-artificial-intelligence-spreading-beyond-technology-sector-big-consequences) description recently that summed up very well this step-change in computing:

> “Computers have been able to read text and numbers for decades, but have only recently learned to see, hear and speak.”

For my demo application I focused on two ML capabilities: [**Image Analysis**](https://en.wikipedia.org/wiki/Image_analysis) (a.k.a Computer Vision) and [**Sentiment Analysis**](https://en.wikipedia.org/wiki/Sentiment_analysis) (a.k.a Natural Language Processing).

#### What is Image Analysis?

Going back to the earlier quote, put simply, Image Analysis is the capability for computers to now “see”. More concretely, this ‘Computer Vision’ is how faces can be detected within photos. Or it is how a Self-Driving Car may continually [process](https://www.technologyreview.com/s/539841/one-camera-is-all-this-self-driving-car-needs/) it’s surroundings to detect the pedestrian crossing the road ahead.

In my application I use this capability to produce ‘labels’ to annotate the central photo that is accompanying the BBC News article. In effect, describe the contents of the photo if you could not see it.

#### What is Sentiment Analysis?

Sentiment Analysis is simply categorising a piece of writing on whether it is positive, neutral or negative in its content. An example use would be an application automatically processing product feedback left by a user and flagging it for follow-up if it seems negative. A marketing department may also wish to monitor live tweets and have it’s team intervene if there are negative tweets affecting their brand.

In financial services, political and business news can move markets, so sentiment analysis of live news may be an input into automated trading engines that respond to world events in real-time.

In my application I use this capability to ‘read’ the headline and description of the BBC News article and provide it’s sentiment. In other words, is the news about a positive event, neutral or negative?

### Observations so far…

#### Not All Machines Are Created Equal

As mentioned in the beginning, I was surprised to see the differences in results across the three providers. Below is an example result where it was not unanimous between them on what the article sentiment is:

![](https://cdn-images-1.medium.com/max/1024/0*BRDpNEl0zwwRr98v)<figcaption>An example of an inconsistent ML result across the three providers.</figcaption>

As humans, it is quite clear to us that this is a sad and distressing piece of news, yet Google’s [Natural Language](https://cloud.google.com/natural-language/) service deemed it positive in sentiment. In fact the score is 0.9 where 1.0 would represent the maximum for a positive sentiment. It is surprising why words such as “fresh fighting”, “growing violence” and “conflict” have not led it firmly into the negative sentiment territory. Azure’s [Text Analytics](https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/) did the best in this example.

The neutral sentiment determined by AWS’s [Comprehend](https://aws.amazon.com/comprehend/) is also worth highlighting here. That service seems to often play it safe with a ‘on-the-fence’ assessment of ‘neutral’ being its dominant stance:

![](https://cdn-images-1.medium.com/max/1024/0*nO_CaN6L9DoajfRQ)<figcaption>An example of AWS alone providing an outlier result.</figcaption>

On a more happier note, it does seem quite universal though that everyone loves the news of a new Royal Baby:

![](https://cdn-images-1.medium.com/max/1024/0*qi1AUrx2-g9IMzKM)<figcaption>An example of a unanimously agreed result.</figcaption>

### A Picture Paints How Many Words? Well I’ll Tell You…

As you’ve probably noticed, the previous three examples also show quite a difference in the Image Analysis capability too.

The trend appears to be AWS’s [Rekognition](https://aws.amazon.com/rekognition/) yielding many more labels per image compared to Azure’s [Computer Vision](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/) and Google’s [Vision](https://cloud.google.com/vision/) services. A quick scan also shows most of the labels to be relevant to the image too. In fact compared to its ‘on-the-fence’ approach to Sentiment Analysis, the Image Analysis capability is a lot more aggressive and offers up more ‘inferred’ labels that are likely to be associated to the image.

For example, the Royal Baby [article](http://www.bbc.co.uk/news/uk-43876299) has an image of the Royal Horse Artillery firing a 41-gun salute. While just the fired gun, smoke plume, and 3 service personnel are seen, it produced a whopping 27 labels for the image:

**_“Human, People, Person, Cannon, Weaponry, Smoke,_** _Airport,_ **_Weapon,Airfield,_** _Engine, Locomotive, Machine, Motor, Steam Engine, Train, Transportation, Vehicle, Aircraft, Airplane, Jet,_ **_Military, Army, Military Uniform, Soldier, Team, Troop,_** _Warplane”._

Azure and Google seem to be more comparable with each other in that a lesser number of (more focused?) labels are produced. That is, if the service is not completely stumped and produces nothing, as Azure did here:

![](https://cdn-images-1.medium.com/max/1024/0*Upxb1zGFCcgvZuCG)<figcaption>An example result of Azure being an outlier with zero labels produced.</figcaption>

### To Conclude…

This was a very high-level summary of my findings so far. It is in no way a comprehensive review. The demo application is available for you to submit your article choices for analysis and better form your conclusions:

[**http://london.solace.com/cloud-analytics/machine-learning.html**](http://london.solace.com/cloud-analytics/machine-learning.html)

As always, the correct selection of Machine Learning provider will come down to your own usage requirements. For instance, those requirements will determine if a verbose set of labels produced for an image is useful, or whether _less_ is actually more.

One thing we can perhaps take from this is that Machine Learning has made great leaps forward, but we are a long way from [intelligent robots taking all our jobs](https://www.youtube.com/watch?v=7Pq-S557XQU)! The systems still need a little [more stirring](https://xkcd.com/1838/):

![](https://cdn-images-1.medium.com/max/742/0*1VXu3YqXG_CCObTl)<figcaption>xkcd.com on Machine Learning</figcaption>

Please do let me know what you thought. I have a program on standby to perform sentiment analysis of the comments on this post and automatically reply with the relevant emoji.

![](https://cdn-images-1.medium.com/max/650/0*ioDDrg_mh5zJScpi)

_Originally published at_ [_https://www.linkedin.com_](https://www.linkedin.com/pulse/comparing-machine-learning-through-bbc-news-analysis-jamil-ahmed/)_._