Identify sentiment of comments in a Yammer group by using Azure Cognitive Services and Flow

Identify sentiment of comments in a Yammer group by using Azure Cognitive Services and Flow

This article shows you how to set up a Yammer group to collect feedback and ideas for continued improvement, and have one person in your organization notified immediately when a specific sentiment, such as positive or negative feedback is posted. This solution uses Azure Cognitive Services to analyze the posted messages, and uses Microsoft Flow to connect Yammer, Azure Cognitive Services, SharePoint Online and Outlook.

 

Once you have this integration set up with examples of positive and negative feedback, an email will be sent to a designated person whenever a negative message is posted so that a response can be posted quickly. You can easily modify the integration to send email to track other types of opinions.

 

Prerequisites

  • An Azure subscription and an account with permissions to create Resource groups and other Azure resources.
  • An Office 365 license: Business Essentials/Premium or Enterprise E1/E3/E5.

Step 1: Download flow package needed for this integration

This article has an associated flow package that is stored in the file DetectSentiment.zip.

Download the DetectSentiment.zip file from the Yammer technical community.

File Description
DetectSentiment.zip Zip file containing a package for the flow that connects Yammer to Azure Cognitive Services.

 

Step 2: Create Yammer group

In this step, you create the Yammer group to post the messages to.

  1. In a web browser, open https://www.yammer.com, and sign in with your organization account.

  2. In Yammer, click + Create a group.
    yammer-home.png

     

  3. Click INTERNAL GROUP.
    create-yammer-group.png

    1. Enter a Group Name. For example: zzYammerGroup.
    2. Enter Group Members.
    3. Select Public Access.

  4. Click Create Group.

    The newly created group is added in the left navigation.

    yammer-group-leftnav.png

Step 3: Create a SharePoint list to store sentiment data

In this step, you create a SharePoint list to store the sentiment data that Azure Cognitive Services uses to determine what is negative feedback.

 

  1. Click the button in the top left of the screen and select SharePoint.
    sharepoint-yammer.png

    Make sure you would have necessary permissions to create a SharePoint list in a SharePoint site.

  2. Create a new list named SentimentAnalysis.

    1. Click + New > List.
      ask.png

    2. In the Name textbox, enter SentimentAnalysis, then click Create.
      create list.png

  3. Create a new column named Score.
    1. Click + Add column > Number.
      add-number-column.png

    2. In the Name textbox, enter Score, then click Save.
      add-number-column-detail.png
  4. Create a new column named Message Link.
    1. Click + Add column > Hyperlink.
      hyperlink.png

    2. In the Name textbox, enter Message Link, then click Save.
      add-link-column-detail.png
  5. Copy and save the URL to the list you created, you will need it in subsequent steps.

Step 4: Create a Cognitive Service

Create a Cognitive Service to perform sentiment analysis for the messsages posted in the Yammer group.

 

  1. In a web browser, open the Azure Portal.
  2. Click + Create a resource, then enter Create a resource in the search box.
    create-cognitiveservice.png

    1. Select Cognitive Services.
      create-cognitiveservice-1.png

    2. Click the Create button.
      create-cognitiveservice-2.png

  3. Create a Cognitive Service
    create-cognitiveservice-detail.png

    1. Enter a Name. For example: SentimentAnalysis

    2. Select a Subscription.

    3. Select a Location.

    4. Select a Pricing tier For example: S0

    5. Create a new Resource group.

    6.  Click the Create button.

      A new Cognitive Services instance is created.

  4. Select the Cognitive Service you just created. You will find it in the new Resource group.
    select-cognitiveservice.png

  5. In the RESOURCE MANAGEMENT section, click Keys.

  6. Copy and save the NAME and KEY values, you will need them in subsequent steps.
    select-cognitiveservice-detail-1.png

  7. In the RESOURCE MANAGEMENT section, click Keys.

  8. Copy and save the NAME and KEY values, you will need them in subsequent steps.
    select-cognitiveservice-detail-2.png

Step 5: Import and update the Yammer Sentiment Analysis flow

Use the Yammer Sentiment flow zip file you downloaded in Step 1 and update it to work in your environment.

 

  1. In a web browser, open https://flow.microsoft.com, and sign in with your work account.

  2. Upload the package.

    1.  Click My flows.
      flow-my-import.png
    2. Click Import.
      flow-import-package.png

    3. Click Upload, then select the DetectSentiment.zip file you downloaded.
      upload-flow-package.png

  3. After the package has been uploaded, modify the IMPORT SETUP configuration for the Related resources.
    create-new-sentiment-flow.png


    1. In the sentiment-analysis resource, click Select during import.
      flow-setup-qna-maker.png

    2. Click + Create new.
      flow-new-connection.png

    3. Click + New connection, then search for Text Analytics.
      create-text-analytics.png

    4. Click the Text Analytics connector provided by Microsoft.
      create-text-analytics-detail.png

  4. Enter the KEY you saved in a previous step for the Account Key.

  5. Enter the Endpoint you saved in a previous step for the Site URL.

  6. Use the previous steps as a guide to configure the remaining connections (shown in the red rectangles in the picture below). Refer to the screenshots below for all the connections to help you search for and locate the appropriate connections.
    flow-relatedresources.png

    1. SharePoint Connection
      flow-new-sharepoint-connection.png
    2. Office 365 Outlook Connection
      flow-outlook.png

    3. Yammer Connection
      flow-new-yammer-connection.png

  7. Click Import at the bottom of the page.
    flow-importing.png
  8. After the flow has successfully imported, click Open flow.
    flow-uploaded.png
  9. Update the flow.
    flow-detail.png


    1. Click the first node in the flow.
      flow-select-yammer-group.png

    2. In the Group Id dropdown list, select the Yammer group you created earlier, then select the correct network.

    3. Click the Create item node.
      flow-select-create-item.png

  10. In the Site address dropdown list, select the SharePoint site where you created the SharePoint list.

  11. In the List name dropdown list, select the Sharepoint SentimentAnalysis list you created.

    1. Detect if this is negative or positive comment from Yammer group.
      flow-cognitiveservice.png
    2. Configure the email information.
      flow-email.png

    3. In the To textbox, enter the email address where you would like notifications to be sent when the sentiment value indicates the message posted in Yammer is negative.
    4. In the Subject textbox, enter the subject you would like the email to have.
  12. Click Save.
    save-flow.png

 

Step 6: Post messages in the Yammer group to trigger the sentiment analysis flow

Post message in Yammer discussion group to trigger the Yammmer Sentiment Analysis flow.

 

  1. In a web browser, open https://www.yammer.com, and sign in with your organization account. Find and open the Yammer group you created earlier.
    find-yammer-group (1).png
  2. Post positive and negative messages to the group.

    Negative message example: I am very frustrated by our lack of healthy eating options in the cafeteria. What can we do to improve this?
    negative-message.png

    Positive message example: I'm really loving our focus on empowering all employees to achieve more. So proud to work for the amazing company!
    positive-message.png

    Both the positive and negative messages are added to the SharePoint list you created.
    messages-in-sharepoint-list.png

    If you posted a negative message, an email is sent to the Inbox you configured.
    negative-message-email.png

Please note that it takes a few minutes for the flow to execute after the messages are posted to Yammer.

 

Thank you to Todd Baginski, Microsoft MVP, and Chris Bortlik for developing this integration.

Version history
Revision #:
10 of 10
Last update:
‎04-03-2019 04:48 PM
Updated by:
 
Labels (2)
Contributors