703 964 8217

Home » Portfolio » Office 365 Addin + IBM Watson

Office 365 Addin + IBM Watson

Outlook Office 365 Addin evaluates the message subject and gives the user a graphical representation of the score of the various emotions associated with the message.

Use Case:

As a Customer Service Representative you receive emails every day and you would like to know the emotions associated with each email to prioritize the ones which need attention. I am sure the ones which have a positive satisfied tone can wait while the ones which have a tone of “Anger” or “Disgust” need to be processed actively.

By leveraging the Natural Language processing capabilities of IBM Watson Tone Analysis service, the app presents a chart with scores for each of the five emotions : Anger, Disgust, Fear, Joy, Sadness and enables the user to make a decision.

Screen shot inside your Office 365 Mail Client:

EmotionMeter-Screenshot

Development Gotchas:

  • ‘Access-Control-Allow-Origin’ header is present on the requested resource:

Since the VS 2012 now runs using IIS Express we need to make changes to the ApplicationHost.config file in IIS Express config to allow this behavior.

IISDevServerChanges

  • Hardcoded URL for Ajax Call to get the Watson Results:

In Ajax call, instead of using the absolute URL to https://localhost:{port}/api/values?Subject=” decided to use relative paths

  • Chart.js:

Planning to use CDN for the Charts but soon realized that the Charts.js could be simply moved to the App Folder. Would surely like to switch to CDN but that’s for later.

  • Protecting Watson Credentials:

If you intend to share your source code adding our API Keys or Username and password combination in public GitHub Repositories can be a great threat given anybody can use them in their application.

In my code, I read my Watson UName and Pwd from configuration

WatsonUNamePwdUsage

However if I check in my web.config then the other users might be able to get access to the UID and PWD.

The trick to avoid that is by not checking in your web.config or by checking in your web.config without those values and setting them using the Application Settings section on the Azure Portal.

WatsonUNamePwdInEnvironmentConfigs

  • Deployment to Azure Websites:

I opted for a local GIT Repository on the Azure Portal for the deployment setup.

Note: Git init at the folder which has the .sln file

  • Https Endpoint for Azure Website:

All Azure websites have an Http and Https endpoint and there is no need to buy a separate SSL Certificate.

Resources

  1. Microsoft Office Developer 365 account (1 Year subscription)
  2. Watson Tone Analysis service by IBM Bluemix.
  3. VS 2015 Community Edition
  4. Getting started with Office 365 AddIn in Visual Studio
  5. Leveraging IBM Watson Service in Visual Studio
  6. .GitIgnore file for ASPNET Projects.
  7. Deploying to Azure Websites using Source Control