Sentiment Analysis in Excel 365

Sentiment Analysis integrates part of the functionality provided by the Sentiment Analysis API. It provides two levels of analysis: a global, more general sentiment analysis of the whole text, and a feature-level analysis, which shows the aggregated polarity of each entity and concept detected in the text.

On the right, you can see the sidebar that appears when you click the Analyze sentiment button.

There are two sections in the interface: Select cells with texts to analyze, which we have already covered in the corresponding section, and Analysis settings.

In Analysis settings you can configure three values:

  • Language, to select the language of the texts. Refer to the list of supported languages to learn about the languages available.
  • Model, to select the model that will be used to measure the sentiment of the texts. The models listed are associated to specific languages, so the two values must be coherent. Currently, the only model available for all languages is General, but all the languages support the user sentiment models defined in the sentiment models customization console that are associated to the license key introduced in the settings panel.
  • Sentiment Analysis user model
  • User dictionary, to select if you want to use one of your user dictionaries in the analysis. The dictionaries that will appear in this menu are the ones created through the dictionaries customization console that are associated to the license key introduced in the settings panel.
  • Sentiment Analysis user dictionary
Sentiment Analysis user interface

Advanced settings

The Advanced settings menu contains additional options for Sentiment Analysis. There are three differentiated sections: Analysis type, where you can select which type of sentiment analysis you want to carry out; Document analysis, where you can configure which fields you want to output when you analyze the sentiment of a document, and Topic analysis, where you can configure which fields you want to output when you analyze the sentiment of the topics featured in a document:

  • Analysis type: select which type of sentiment analysis you want to carry out. There are two possible values and at least one of them must be selected:
    • Document, to extract the global sentiment of a text.
    • Topics, to extract the topics of a text and find the polarity associated to each one of them.
    Both analyses are independent from each other and are selected by default.
  • Document analysis: in this section you can configure which fields you want to output when you analyze the sentiment of a document. There are five possibilities:
    • Polarity: shows the polarity tag obtained for the text. If no polarity has been detected, its value will be NONE; each value will have a color according to this scheme:
        Sentiment Analysis polarity colors
    • Agreement: shows the agreement between the polarities detected in the text.
    • Subjectivity: shows the subjectivity value obtained for the text.
    • Confidence: shows the confidence value associated to the polarity detected.
    • Irony: shows if the text is considered ironic.
  • Topic analysis: in this section you can configure which fields you want to output when you analyze the sentiment of the topics detected in a document. There are six options:
    • Form: shows the name by which the topic extracted is identified. It's non-configurable, so it always appears in the results.
    • Topic category: shows the type of topic extracted, that is, if it's an entity or a concept.
    • Rank: contains the order in which the topics have been detected. It's specific for each type of topic, that is, the first entity detected will be ranked 1, and the first concept will be ranked 1 too.
    • Type: shows the type associated to the topic according to our ontology.
    • Polarity: shows the polarity tag obtained for the topic. It behaves the same way as the polarity tag we've shown for Document Analysis.
    • Sense ID: shows the ID of the topic detected.
Sentiment Analysis advanced settings

You can read more information about each one of these fields in the response section of the API documentation.

Output

There are two different types of sentiment analysis that can be carried out. Both of them will be shown in a new separate spreadsheet:

  • The document-level analysis will be displayed in a sheet called "Sent. Analysis Document".
  • The feature-level analysis in a sheet called "Sent. Analysis Topics".

This means that if both analysis options are selected, Sentiment Analysis will result in two new sheets.

Both sheets will include a column with the source text, a column with the IDs if enabled, and a column for each one of the output fields configured in the advanced settings.

This is an example of a possible output of the document-level polarity of some texts in English using the model General. The configuration is set to show all the available output fields:

The following example shows a possible output of the sentiment analysis at a feature level, which displays the topics found in the text and their polarity. The analysis of the example has been carried out using the General model and showing all the available output fields.

You can see in the image above how each topic found in a text is inserted in a new row.