Skip to content

brminnick/SentimentAnalysis

Repository files navigation

Sentiment Analysis

This app was made in conjunction with the Microsoft Blog, Upgrade Your App With Sentiment Analysis.

Happy Sentiment Sad Sentiment
Happy Sentiment Sad Sentiment

Microsoft's Cognitive Services team have created the Sentiment Analysis API that uses machine learning to determine the sentiment of uploaded text. And the best part is, we don't need to be machine learning experts to use it.

I just submit the text as a POST Request:

{
  "documents": [
    {
      "language": "en",
      "id": "251c99d7-1f89-426a-a3ad-c6fa1b34f020",
      "text": "I hope you find time to actually get your reports done today."
    }
  ]
}

And the API returns back its sentiment score:

{
"sentiment": {
  "documents": [
    {
      "id": "251c99d7-1f89-426a-a3ad-c6fa1b34f020",
      "score": 0.776355504989624
    }
  ]
}

The sentiment score ranges between 0 and 1.

Scores close to 0 indicate negative sentiment, while scores close to 1 indicate positive sentiment.

Learn More