Every day, millions of Internet users share their opinions on a range of topics. These are mostly raw, voluntary, and unsolicited views about a brand, product, or service. Every organization on the planet cares about their customers and customer reviews. The challenge? There's far more data out there than that can be manually analysed. What if we had a helping hand? What if you could use AI services to analyze these sentiments and opinions. What if you could use a single API call to understand how do users truly felt about your solutions. Azure Cognitive Service for Language provides the Sentiment Analysis and Opinion Mining features to do just that. Let me tell you why you may need this Emotion AI. Typically, when users give 5-star ratings, you know that the sentiment is positive. A one-star rating, not so much. Sometimes, you don’t get any ratings. Instead, all you've got is a piece of text.

Think Twitter- Let's say a customer tweets a comment. How do you actively monitor social media, stay fully present, analyze customer responses, and manage reputation- all at the same time? Now, at scale - think thousands of such reviews that could potentially provide valuable feedback for you, your product or service? Sometimes, you may need to attend to users at real time. If you can analyze sentiments, you can find and prioritize your most valuable customer interactions. You can improve customer retention & acquisition rates. You can deliver a superior customer experience. Now this is not just for social media sites or customer communication channels. Organization could use this for employee surveys. Anywhere you'd want to understand how your users truly feel.

Azure Cognitive Services makes it very easy because now using Prebuilt AI services, you can understand the sentiment behind a piece of text. How it does this is very simple. When you invoke the Sentiment Analysis API, with this piece of text, it will analyze the text and return the overall sentiment as a numerical rating known as a “sentiment score”. It is a number between 0 and 1. The more the score is towards 0 it is indicative of a negative sentiment. The more it is towards 1, it is indicative of a positive sentiment. At the center is neutral. You can do this to analyze sentences, paragraphs or entire documents. For example, let's take a look at a customer review for a hotel -"I loved the hotel location, and the customer service was excellent”. If you pass this piece text to the API, it would return a sentiment score of nearly 1 indicating it’s a positive sentiment. Now let's try something else-” I loved the hotel location but was disappointed with room service.” It's a little tricky to classify it as a positive or negative sentiment because there are multiple drivers here- the hotel location and room service. In such cases, we need something more than Sentiment analysis. We need Opinion Mining or Aspect-based sentiment analysis (ABSA), which breaks down the data into smaller fragments and assigns sentiments to specific topics. In this example, there is a mixed sentiment because there's more than one topic being discussed in a single sentence. Opinion Mining extracts and separates each aspect: Location and Room Service. It will attribute a sentiment to each aspect: The location was great (Location → Positive) but the room service was disappointing (Room Service → Negative).

When we can understand a user’s emotions and the specifics thereof, we can leverage that information to personalize the conversational experience for them. If you are looking to save time and act faster in analyzing sentiments and mining opinions, let me show you how.

So let me show you how to get started with some of the features that we discussed in this episode, which is sentiment analysis and opinion mining. So, to get started, what we need is an Azure subscription. If you have an Azure subscription, you are good to go. If not, you can sign up for a trial Azure subscription and you get a free Azure credit with that. So, once you're in, you can go to the marketplace and you can search for language, which is probably the easiest way to find the language service. When you click ‘create’, you will be asked for the name of your resource, the resource group, the location, etc. And once you furnish those details, you'll have your language service up and running. A couple of things from the language service are two things that we need to note. One is the key and the endpoint so. The key and the endpoint is important for us to authenticate the API as we invoke the APIs in our code, so that's one way of doing it. You can start with a programming language of your preference, C#, Java, Python you have SDK for the same. You can call the rest API's and you can try out these features. You can parse the APIs and see the response. Another way of doing this is a simpler way of by using a tool called Language Studio. It's a web portal. You can test out the natural language capabilities in here, of which one is sentiment analysis and opinion mining. So let's try that out. As you can see, you can provide a text language. You can reference the specific Azure resource that you just created and then you can either upload a document of your choice, you drag and drop your own text files, or you can try it out with one of the samples available here.

You also have an option of turning on Opinion mining. So, opinion mining is a parameter that you would ideally pass with the API if you need to find out deeper insights. So, let's turn on opinion mining. Let's try out one of the samples here if I were to run this. I see that at a very high level I get to see the document sentiment, which is mix it at this point, but at a deeper level, because I have turned on opinion mining, I get to see very granular results. For example, the context of foot place, as you can see that target will hover over it. You'll see that the assessment for that is positive. it's 100% positive sentiments of the very happy with the location because as you can see the people, they say we adore the spot, so that's one way of doing it. If you look at dining, it's again got 100% positive sentiment, so you can deep dive and look at the specific opinions of the text in the text. So, from here, if you would like to delve deeper, you can go and read the technical documentation at Try out the samples in GitHub, you know. Get the SDK and you can start working in code as well.

It is said that the greatest fear in the world is of the opinions of others. Guess what- you don’t have to worry about them if you can analyze them effectively and find out what exactly makes your users tick. 

Azure Cognitive services for language provides sentiment analysis and opinion mining features to help you understand exactly what your users feel. And more importantly, why they feel what they feel.