Use Cases

Sentiment Analysis Using Google Sheets

Hernán Correa
by Hernán Correa

Sentiment Analysis Using Google Sheets

Google Sheets is a great tool for creating and editing spreadsheets right into your browser. You can store and organize data to do some traditional number-crunching and data manipulation. But it can also do much more, like visualizing information in beautiful charts and graphs and build powerful macros to automate your work.

But, what happens when you want to analyze the data in your spreadsheets?

Say that you have thousands of rows with customer feedback, product reviews or tweets in a spreadsheet. How can you process all this information and get insights from your data? How can you understand what people are praising or complaining about without having to manually go over each text?

Enter sentiment analysis.

When you have too much data to process manually, you can use sentiment analysis right into your spreadsheets to automatically sort through your data, get insights, and save time.

In this post, we’ll go over how you can use MonkeyLearn add-on for doing sentiment analysis in Google Sheets and analyze your data at scale.

Sentiment Analysis Right in Your Spreadsheet

Adding value to your spreadsheets by performing Sentiment Analysis is pretty straightforward. No previous coding experience is needed at all. With MonkeyLearn’s Google Sheets add-on, you are a couple of clicks away from analyzing sentiment. You just need to follow 5 simple steps:

1. Log in to Your Google Account

Log in to your Google account and open Google Sheets.

2. Install MonkeyLearn’s Google Sheets Add-on for Sentiment Analysis

Go to the Add-ons menu in Google Sheets and click Get Add-ons:

Installing the add-on for sentiment analysis in Google Sheets
Installing the add-on

Then, search for MonkeyLearn in the Google Sheets marketplace and add the add-on for free:

3. Insert Your API Key

Once you have installed MonkeyLearn’s Google Sheets add-on, you will have to insert your API Key. Go here to get your API Key. Copy your key to your clipboard and go to the Add-ons menu, MonkeyLearn, and click Set token. A pop up with a textbox will appear for you to type or paste your API Key:

Inserting the API key

4. Upload Your Data and Choose What to Analyze

You are now ready to import or upload the data you want to analyze. Once you have your data on a spreadsheet, make sure to organize the texts you want to analyze so that they are laid out in only one column.

Then, go to Add-ons, MonkeyLearn, and click Start: 

Starting the add-on on Google Sheets

A docked box will appear to the right of your screen. The box is divided into two sections: the model selection and the data selection sections:

The docked box on the right of the screen

First, choose the model you would like to use in your analysis. In this case, choose Sentiment Analysis, a pre-trained and ready to use model on MonkeyLearn. You can also use a custom model for sentiment analysis by choosing Use another model ID and providing the model ID of your model.

Second, choose the data you would like to analyze. You can do so by selecting the Active Range radio button to analyze the cells you have selected on the spreadsheet. Alternatively, you can click the Column or range radio button and type the range of cells that contains the data you would like to analyze:

Typing the range of cells that contains the data

Remember: The add-on does not allow submitting more than one range of cells (e.g. A2:A3000; A5000:A7000). If you provide more than one range of cells, MonkeyLearn will only analyze the last one in the series.

5. Run Sentiment Analysis

Click Run in the MonkeyLearn’s add-on box to run the sentiment analysis on your data. By default, the results will be inserted in one or more columns to the right of the column that contains the texts.

Things you might want to try…

Tweet Sentiment Analysis

How positive or negative are the comments of those who talk about you, your brand, or your products on Twitter? We have created a Tweet Sentiment model to help you analyze that. You can choose it from our list of models in the add-on and run the Analysis:

Sentiment analysis on tweets
Sentiment analysis on tweets

As you can see, the model might return a low confidence score with an incorrect sentiment label. This is not bad in itself since sentiment analysis is pretty complex and you are likely to need to filter out the predictions below a confidence threshold of your choice.

Reviews Sentiment Analysis

Are people saying positive or negative things about a product? The screenshot below shows some product reviews, their sentiment, and the confidence of the prediction. In order to classify those, we used MonkeyLearn’s Product Sentiment Classifier:

Sentiment analysis on reviews
Sentiment analysis on reviews

In this case, all predictions were accurate, that is, their sentiment labels were correct and confidence scores were pretty high.

NPS Feedback Sentiment Analysis

NPS (Net Promoter Score) is a customer satisfaction metric related to the question How likely are you to recommend our company to others? Usually, that question is accompanied by an open-ended question like What can you tell us about our company? or Can you tell us why you rated us 9?

We can use the power of sentiment analysis to analyze this open-ended feedback from NPS surveys:

Sentiment analysis on NPS feedback
Sentiment analysis on NPS feedback

Final Words

Once your texts have been analyzed, check your predictions. Bear in mind that a prediction is a combination of two things, namely, a tag (in this case, a sentiment) and its confidence.

Sentiment analysis is a very complicated natural language processing (NLP) task and it has been a “trending research topic” for a while, probably due to its complexity. So, when reviewing sentiment analysis results, take the following into consideration.

Most often, people do not take the confidence of the prediction into account and this is particularly problematic when it comes to sentiment analysis. Depending on the data you submit, there will be a confidence threshold below which you will be more likely to get the sentiment wrong, so you might want to check the predictions that fall below that confidence threshold for mistakes. You will also get some of the predictions right even if their confidence are low, but we recommend that you double-check.

Also, it is important to note that generic sentiment models might not be the best idea when performing sentiment analysis due to its complexity. You are likely to get better results by training a custom classifier with your own data and criteria.

Pre-trained sentiment analysis models are usually trained with a variety of types of texts from different domains. Therefore, if your data contains texts or expressions which do not belong to the domains used to train these models or if your texts look very different from the ones used for training, you are likely to get some inaccurate predictions (see above).

So, once you feel comfortable using this Google Sheets add-on for analyzing data on your spreadsheets and you’re looking to increase the accuracy of the predictions, a good next step would be to train your own custom model for sentiment analysis.

All in all, Google Sheets and the MonkeyLearn add-on make sentiment analysis accessible, straightforward, and easy. The combination of these tools can also help you do a lot more with your data. Why don’t you install the add-on and start doing fun analyses? Feel free to share any interesting insights you may find in the comments section below!

Hernán Correa

Hernán Correa

Notification

Have something to say?

Text Analysis with Machine Learning

Turn tweets, emails, documents, webpages and more into actionable data. Automate
business processes and save hours of manual data processing.