1.0.1 • Published 7 years ago

essentiment-analyzer v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Sentiment Analyzer

This is a simple package you can use to analyse the sentiment of message using microsoft's azure sentiment analysis

Prerequisites

Installation

  • Run npm install microsoft-sentiment

Getting Started

  1. Run npm install
  2. The analyzer takes 2 parameters, the region your azure service is hosted and the api key
  3. To analyse a message call it with 4 parameters:

    The message you want to analyse language, the language your message is in, for supported languages check the microsoft webpage The threshold you want you message to be above (or below) A message ID

Sample:

const sentimentAnalyzer = require('microsoft-sentiment');

let analyser = new sentimentAnalyzer('westeurope', '<your api key here>');

analyser.analyseMessage('your message to be analysed here', 'en', 0.75, 1234 (sentimentBelowThreshold) => {
    console.log(sentimentBelowThreshold)
});