@botbuildercommunity/text-analytics-middleware
Advanced tools
Comparing version 0.1.2 to 0.2.2
{ | ||
"name": "@botbuildercommunity/text-analytics-middleware", | ||
"version": "0.1.2", | ||
"version": "0.2.2", | ||
"description": "Bot Framework middleware component for the Cognitive Services Text Analytics API, including sentiment analysis, language detection, entity extraction, and keyword recognition.", | ||
@@ -11,3 +11,3 @@ "main": "./lib/index.js", | ||
"scripts": { | ||
"postinstall": "tsc -p .", | ||
"build": "tsc -p .", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -39,6 +39,8 @@ }, | ||
"azure-cognitiveservices-textanalytics": "^2.0.0", | ||
"botbuilder": "^4.0.6", | ||
"ms-rest-azure": "^2.5.9", | ||
"typescript": "^3.1.1" | ||
"botbuilder": "^4.3.4", | ||
"ms-rest-azure": "^2.5.9" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.4.1" | ||
} | ||
} |
@@ -11,7 +11,9 @@ # Text Analytics Middleware | ||
All middleware is created and use in the same way. For example, for sentiment analysis, import the `SentimentAnalysis` class from the package, and add it to your bot adapter: | ||
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/text-analytics-middleware"; | ||
```typescript | ||
import { SentimentAnalysis } from '@botbuildercommunity/text-analytics-middleware'; | ||
adapter.use(new SentimentAnalysis(YOUR_TEXT_ANALYTICS_KEY, TEXT_ANALYTICS_API_ENDPOINT, SERVICE_CLIENT_OPTIONS)); | ||
adapter.use(new SentimentAnalysis(YOUR_TEXT_ANALYTICS_KEY, TEXT_ANALYTICS_API_ENDPOINT, SERVICE_CLIENT_OPTIONS)); | ||
``` | ||
@@ -31,7 +33,7 @@ > Note that the TEXT_ANALYTICS_API_ENDPOINT will be the Cognitive Services endpoint root. For example: https://eastus.api.cognitive.microsoft.com | ||
In each case, properties are added to the `turnState` of the `TurnContext` You can retrieve them in your bot via: | ||
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("language")` //This is a string for `LanguageDetection` | ||
* `context.turnState.get("keyPhrases")` //This is an array of strings for `KeyPhrases` | ||
* `context.turnState.get("textEntities")` //This is an array of `EntityRecord` types` for `EntityExtraction` | ||
* `context.turnState.get('sentimentScore')` //This is a number for `SentimentAnalysis` | ||
* `context.turnState.get('language')` //This is a string for `LanguageDetection` | ||
* `context.turnState.get('keyPhrases')` //This is an array of strings for `KeyPhrases` | ||
* `context.turnState.get('textEntities')` //This is an array of `EntityRecord` types` for `EntityExtraction` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
71523
3
1732
38
0
6
1
1
- Removedtypescript@^3.1.1
- Removedtypescript@3.9.10(transitive)
Updatedbotbuilder@^4.3.4