As we nurture our culture in Microsoft, we are encouraged to embrace the growth mindset. We are better together, especially when fostering an inclusive and diverse environment. Constructive feedback is key to help you and your colleagues to grow. Today’s post is about adding another tool to your constructive feedback mission.
In this post, we will build an application level add-in, and deploy it to Outlook using Microsoft Visual Studio Tools for Office (VSTO). The add-in will use Microsoft Cognitive Services Text Analytics API to analyze the sentiment of your email contents, and give you feedback.
You can find the source code of our sample on GitHub: https://github.com/codedebate/Samples-ConstructiveFeedbackAddIn.
Step 1: Let’s agree on the scope of our sample
Honestly, it took me a while to agree on a direction. Should the add-in analyze automatically the sentiment of every email using machine learning? or should it be reactive, where users will have to consult it?
When its about user experience, automatically scanning every email the user sends makes a lot of sense, yet requires lots of maintenance e.g. anonymization list to remove all keywords that might indicate your identity like company names, products, and even people before consulting Microsoft Cognitive Services Text Analytics API. In addition, the need of the user consent, privacy, etc.
To ease the pace, we will host our logic inside an Office Ribbon button to be invoked re-actively upon the user’s wish.
Being hosted within the same process, application level add-ins should be thin aka most if not all the logic processing should happen externally. Therefore, we will create an ASP.NET Web API and deploy it to an Azure Web App. When invoked, the add-in will send a POST action to the API with the content of the email. Upon receiving the response, it will display a message with the detected sentiment.
The below screenshots describe the add-in in action. Notice that I used the sentiment visuals from Twemoji on Git Hub and WordPress Emoji Everywhere. Twitter open sourced and published them on Git Hub. Thank you Twitter 🙂