
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@botbuildercommunity/middleware-text-analytics
Advanced tools
Bot Framework middleware component for the Cognitive Services Text Analytics API, including sentiment analysis, language detection, entity extraction, and keyword recognition.
The Text Analytics Middleware offers Bot Framework middleware components for the Cognitive Services Text Analytics API. You will need an Azure account, as well as a Cognitive Services resource created on Azure. Take a look at the Microsoft Text Analytics API documentation for details.
npm install @botbuildercommunity/middleware-text-analytics --save
All middleware is created and used in the same way. For example, for sentiment analysis, import the SentimentAnalysis class from the package, and add it to your bot adapter:
import { SentimentAnalysis } from '@botbuildercommunity/middleware-text-analytics';
adapter.use(new SentimentAnalysis(YOUR_TEXT_ANALYTICS_KEY, TEXT_ANALYTICS_API_ENDPOINT, SERVICE_CLIENT_OPTIONS));
The CLIENT_OPTIONS parameter is optional.
Note that the TEXT_ANALYTICS_API_ENDPOINT will be the Cognitive Services endpoint root. For example: https://eastus.api.cognitive.microsoft.com
When used, the turnState on the TurnContext will have a property named sentimentScore between 0 and 1. A full example can be seen in the sample bot test file.
Supported middleware classes include:
SentimentAnalysisLanguageDetectionKeyPhrasesEntityExtractionEach class takes the two required parameters in the example usage above (with the SERVICE_CLIENT_OPTIONS parameter being optional).
In each case, properties are added to the turnState of the TurnContext. You can retrieve them in your bot via:
context.turnState.get('sentimentScore') //This is a number for SentimentAnalysiscontext.turnState.get('language') //This is a string for LanguageDetectioncontext.turnState.get('keyPhrases') //This is an array of strings for KeyPhrasescontext.turnState.get('textEntities') //This is an array of EntityRecord typesforEntityExtraction`FAQs
Bot Framework middleware component for the Cognitive Services Text Analytics API, including sentiment analysis, language detection, entity extraction, and keyword recognition.
The npm package @botbuildercommunity/middleware-text-analytics receives a total of 0 weekly downloads. As such, @botbuildercommunity/middleware-text-analytics popularity was classified as not popular.
We found that @botbuildercommunity/middleware-text-analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.