Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@botbuildercommunity/middleware-google-language
Advanced tools
Bot Framework middleware component for the Google Cloud Natural Language service, including sentiment analysis, language detection, entity extraction, and keyword recognition.
The Google Cloud Platform Natural Language API Middleware offers Bot Framework middleware components for the Google Cloud Platform Natural Language API. You will need an Google Cloud account.
npm install @botbuildercommunity/middleware-google-language --save
This package assumes that you have a Google Cloud Platform account. Your Google Cloud key needs to be stored on the filesystem (it's in a JSON file), and a GOOGLE_APPLICATION_CREDENTIALS
environment variable should point to that file. See Google's quickstart guide for more information.
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-google-cloud';
adapter.use(new SentimentAnalysis());
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:
SentimentAnalysis
CategoryExtraction
EntityExtraction
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 SentimentAnalysis
context.turnState.get('categoryEntities')
//This is an array of object containing a name
property and a confidence
property for CategoryExtraction
context.turnState.get('textEntities')
//This is an array of strings for EntityExtraction
Note that the
CategoryExtraction
middleware component might not return any values if the text is too little, or if the classification cannot find a match.
FAQs
Bot Framework middleware component for the Google Cloud Natural Language service, including sentiment analysis, language detection, entity extraction, and keyword recognition.
The npm package @botbuildercommunity/middleware-google-language receives a total of 4 weekly downloads. As such, @botbuildercommunity/middleware-google-language popularity was classified as not popular.
We found that @botbuildercommunity/middleware-google-language 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.