What do your users really think? Using Text Analytics to understand GitHub Issue Sentiment

Avatar

Chris

Launch Notebook Now!

Ever get the feeling your users aren’t that happy with your project? We all get those issues that are real downers on our repository. So I thought, let’s take these issues and make something fun. Using the Text Analytics Service and the WordCloud Python package, we can make some pretty pictures out of otherwise negative comments. I also found it fun to make clouds of the more positive issues.

PTVS-Word-Cloud

Below you will find a few snippets on how to do this yourself. If you want to just run this against your favorite GitHub project you can open a Jupyter notebook using the notebook link above. The below code is shown just to give you an idea of what the notebook does. In order to make it function you would need to complete a few additional bits of code.

 

Step 1: Install some libraries

We use a few libraries and should start by installing them. CortanaAnalytics is a small library to wrap requests to Azure Data Market Services. PyGitHub serves a similar purpose for GitHub. WordCloud helps to make pretty pictures.

 

Step 2: Get API keys to access Azure Text Analytics and GitHub

We need two API keys so we can access some services.

You can get an account key for the Text Analytics Service by signing up at http://azure.microsoft.com/en-us/marketplace/partners/amla/text-analytics
You can get a GitHub API Key by creating a token at https://github.com/settings/tokens.

 

Step 3: Get some issues from GitHub

Once you have API Keys, you just need to get GitHub issues.

Step 4: Analyse an issue using the Text Analytics Service

Once you have the GitHub issues we can iterate on them arranging them into text bits that can be analysed by Text Analytics. We will batch Sentiment requests together for the issue to cut down on the overall number of requests.

 

Step 5: Get Key Phrases

We can also get key phrases using the same issues we used for sentiment.

Step 6: Generate some pretty pictures of our data using WordCloud
And once we have all of that, we can go ahead and make word clouds.

And that’s it. You can try to reproduce this on your own locally or run the notebook and experiment from the Azure Notebooks environment.

 

Launch Notebook Now!

Avatar
Chris Wilcox

Software Engineer, Azure Notebooks

Follow Chris   

No Comments.