New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

botbuilder-sentimentmiddleware

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botbuilder-sentimentmiddleware

Middleware providing sentiment value for incoming messages

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Sentiment Analysis Middleware

Build status

BranchStatusRecommended NPM package version
masterBuild statusNPM package version

Description

This piece of middleware will get sentiment score of each incoming message text using Cognitive Services Text Analytics API and therefore requires a key. There is a free tier which meets most demo/PoC needs. You can get more info at https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/

The implementation detects the language of the text and get the sentiment of the same. Currently, nearly 17 languages are supported. Full list of supported languages can be seen at https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages

Installation

Available via NPM package botbuilder-sentimentmiddleware

Install into your project using the following command in the package manager;

    npm install botbuilder-sentimentmiddleware --save

Usage (Typescript supported)

First create sentimentAnalysisMiddleware object and add it to middleware pipeline

const sentimentAnalysisMiddleware = new SentimentAnalysisMiddleware({textAnalyticsAzureRegion:'{e.g. westeurope}', textAnalyticsKey:'{your text analytics key}',language:'en'})

botFrameworkAdapter.use(sentimentAnalysisMiddleware);

Subsequently you can obtain sentiment score for incoming message in following way:

await sentimentAnalysisMiddleware.sentimentScore(context)

If not used within middleware pipeline, you can still use getSentimentScore method to call cognitive service and obtain the sentiment score on demand.

await sentimentAnalysisMiddleware.getSentimentScore(context)

Keywords

FAQs

Package last updated on 25 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc