1.0.1 • Published 7 years ago
essentiment-analyzer v1.0.1
Sentiment Analyzer
This is a simple package you can use to analyse the sentiment of message using microsoft's azure sentiment analysis
Prerequisites
- A (30 days free) microsoft azure api key
Installation
- Run npm install microsoft-sentiment
Getting Started
- Run npm install
- The analyzer takes 2 parameters, the region your azure service is hosted and the api key
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)
});