@azure/ai-text-analytics 5.1.1-alpha.20210716.1 → 5.1.1-alpha.20220901.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +14 -13
- package/dist/index.js +758 -367
- package/dist/index.js.map +1 -1
- package/dist-esm/src/analyzeActionsResult.js +9 -9
- package/dist-esm/src/analyzeActionsResult.js.map +1 -1
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResult.js +5 -5
- package/dist-esm/src/analyzeSentimentResult.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js.map +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
- package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/detectLanguageResult.js +1 -1
- package/dist-esm/src/detectLanguageResult.js.map +1 -1
- package/dist-esm/src/detectLanguageResultArray.js +1 -1
- package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
- package/dist-esm/src/generated/generatedClient.js +41 -3
- package/dist-esm/src/generated/generatedClient.js.map +1 -1
- package/dist-esm/src/generated/index.js +0 -1
- package/dist-esm/src/generated/index.js.map +1 -1
- package/dist-esm/src/generated/models/index.js +514 -1
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +5 -0
- package/dist-esm/src/generated/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/models/parameters.js +1 -0
- package/dist-esm/src/generated/models/parameters.js.map +1 -1
- package/dist-esm/src/index.js +3 -3
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/lro/analyze/operation.js +29 -71
- package/dist-esm/src/lro/analyze/operation.js.map +1 -1
- package/dist-esm/src/lro/analyze/poller.js +3 -3
- package/dist-esm/src/lro/analyze/poller.js.map +1 -1
- package/dist-esm/src/lro/health/operation.js +41 -82
- package/dist-esm/src/lro/health/operation.js.map +1 -1
- package/dist-esm/src/lro/health/poller.js +3 -3
- package/dist-esm/src/lro/health/poller.js.map +1 -1
- package/dist-esm/src/lro/poller.js +1 -1
- package/dist-esm/src/lro/poller.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/textAnalyticsClient.js +58 -149
- package/dist-esm/src/textAnalyticsClient.js.map +1 -1
- package/dist-esm/src/textAnalyticsResult.js +4 -14
- package/dist-esm/src/textAnalyticsResult.js.map +1 -1
- package/dist-esm/src/util.js +44 -29
- package/dist-esm/src/util.js.map +1 -1
- package/package.json +34 -36
- package/types/ai-text-analytics.d.ts +133 -32
- package/CHANGELOG.md +0 -144
- package/dist-esm/src/generated/generatedClientContext.js +0 -42
- package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
- package/dist-esm/src/tracing.js +0 -12
- package/dist-esm/src/tracing.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Azure Text Analytics client library for JavaScript
|
|
2
2
|
|
|
3
|
-
[Azure
|
|
3
|
+
[Azure Text Analytics](https://azure.microsoft.com/services/cognitive-services/text-analytics/) is a cloud-based service that provides advanced natural language processing over raw text, and includes six main functions:
|
|
4
4
|
|
|
5
5
|
**Note:** This SDK targets Azure Text Analytics service API version 3.1.0.
|
|
6
6
|
|
|
@@ -22,6 +22,7 @@ Use the client library to:
|
|
|
22
22
|
- Perform multiple of the above tasks at once.
|
|
23
23
|
|
|
24
24
|
Key links:
|
|
25
|
+
|
|
25
26
|
- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/textanalytics/ai-text-analytics/)
|
|
26
27
|
- [Package (NPM)](https://www.npmjs.com/package/@azure/ai-text-analytics)
|
|
27
28
|
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/ai-text-analytics)
|
|
@@ -60,7 +61,7 @@ npm install @azure/ai-text-analytics
|
|
|
60
61
|
|
|
61
62
|
To create a client object to access the Text Analytics API, you will need the `endpoint` of your Text Analytics resource and a `credential`. The Text Analytics client can use either Azure Active Directory credentials or an API key credential to authenticate.
|
|
62
63
|
|
|
63
|
-
You can find the endpoint for your
|
|
64
|
+
You can find the endpoint for your Text Analytics resource either in the [Azure Portal][azure_portal] or by using the [Azure CLI][azure_cli] snippet below:
|
|
64
65
|
|
|
65
66
|
```bash
|
|
66
67
|
az cognitiveservices account show --name <your-resource-name> --resource-group <your-resource-group-name> --query "endpoint"
|
|
@@ -120,7 +121,7 @@ For example, each document can be passed as a string in an array, e.g.
|
|
|
120
121
|
const documents = [
|
|
121
122
|
"I hated the movie. It was so slow!",
|
|
122
123
|
"The movie made it into my top ten favorites.",
|
|
123
|
-
"What a great movie!"
|
|
124
|
+
"What a great movie!",
|
|
124
125
|
];
|
|
125
126
|
```
|
|
126
127
|
|
|
@@ -130,7 +131,7 @@ or, if you wish to pass in a per-item document `id` or `language`/`countryHint`,
|
|
|
130
131
|
const textDocumentInputs = [
|
|
131
132
|
{ id: "1", language: "en", text: "I hated the movie. It was so slow!" },
|
|
132
133
|
{ id: "2", language: "en", text: "The movie made it into my top ten favorites." },
|
|
133
|
-
{ id: "3", language: "en", text: "What a great movie!" }
|
|
134
|
+
{ id: "3", language: "en", text: "What a great movie!" },
|
|
134
135
|
];
|
|
135
136
|
```
|
|
136
137
|
|
|
@@ -193,7 +194,7 @@ const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<AP
|
|
|
193
194
|
const documents = [
|
|
194
195
|
"I did not like the restaurant. The food was too spicy.",
|
|
195
196
|
"The restaurant was decorated beautifully. The atmosphere was unlike any other restaurant I've been to.",
|
|
196
|
-
"The food was yummy. :)"
|
|
197
|
+
"The food was yummy. :)",
|
|
197
198
|
];
|
|
198
199
|
|
|
199
200
|
async function main() {
|
|
@@ -228,7 +229,7 @@ const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<AP
|
|
|
228
229
|
const documents = [
|
|
229
230
|
"Microsoft was founded by Bill Gates and Paul Allen.",
|
|
230
231
|
"Redmond is a city in King County, Washington, United States, located 15 miles east of Seattle.",
|
|
231
|
-
"Jeff bought three dozen eggs because there was a 50% discount."
|
|
232
|
+
"Jeff bought three dozen eggs because there was a 50% discount.",
|
|
232
233
|
];
|
|
233
234
|
|
|
234
235
|
async function main() {
|
|
@@ -258,7 +259,7 @@ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-anal
|
|
|
258
259
|
const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<API key>"));
|
|
259
260
|
const documents = [
|
|
260
261
|
"The employee's SSN is 555-55-5555.",
|
|
261
|
-
"The employee's phone number is (555) 555-5555."
|
|
262
|
+
"The employee's phone number is (555) 555-5555.",
|
|
262
263
|
];
|
|
263
264
|
async function main() {
|
|
264
265
|
const results = await client.recognizePiiEntities(documents, "en");
|
|
@@ -288,7 +289,7 @@ const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<AP
|
|
|
288
289
|
const documents = [
|
|
289
290
|
"Microsoft was founded by Bill Gates and Paul Allen.",
|
|
290
291
|
"Easter Island, a Chilean territory, is a remote volcanic island in Polynesia.",
|
|
291
|
-
"I use Azure Functions to develop my product."
|
|
292
|
+
"I use Azure Functions to develop my product.",
|
|
292
293
|
];
|
|
293
294
|
|
|
294
295
|
async function main() {
|
|
@@ -330,7 +331,7 @@ const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<AP
|
|
|
330
331
|
const documents = [
|
|
331
332
|
"Redmond is a city in King County, Washington, United States, located 15 miles east of Seattle.",
|
|
332
333
|
"I need to take my cat to the veterinarian.",
|
|
333
|
-
"I will travel to South America in the summer."
|
|
334
|
+
"I will travel to South America in the summer.",
|
|
334
335
|
];
|
|
335
336
|
|
|
336
337
|
async function main() {
|
|
@@ -363,7 +364,7 @@ const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<AP
|
|
|
363
364
|
const documents = [
|
|
364
365
|
"This is written in English.",
|
|
365
366
|
"Il documento scritto in italiano.",
|
|
366
|
-
"Dies ist in deutscher Sprache verfasst."
|
|
367
|
+
"Dies ist in deutscher Sprache verfasst.",
|
|
367
368
|
];
|
|
368
369
|
|
|
369
370
|
async function main() {
|
|
@@ -403,7 +404,7 @@ const client = new TextAnalyticsClient("<endpoint>", new AzureKeyCredential("<AP
|
|
|
403
404
|
|
|
404
405
|
const documents = [
|
|
405
406
|
"Prescribed 100mg ibuprofen, taken twice daily.",
|
|
406
|
-
"Patient does not suffer from high blood pressure."
|
|
407
|
+
"Patient does not suffer from high blood pressure.",
|
|
407
408
|
];
|
|
408
409
|
|
|
409
410
|
async function main() {
|
|
@@ -437,14 +438,14 @@ const documents = [
|
|
|
437
438
|
"Microsoft was founded by Bill Gates and Paul Allen.",
|
|
438
439
|
"The employee's SSN is 555-55-5555.",
|
|
439
440
|
"Easter Island, a Chilean territory, is a remote volcanic island in Polynesia.",
|
|
440
|
-
"I use Azure Functions to develop my product."
|
|
441
|
+
"I use Azure Functions to develop my product.",
|
|
441
442
|
];
|
|
442
443
|
|
|
443
444
|
async function main() {
|
|
444
445
|
const actions = {
|
|
445
446
|
recognizeEntitiesActions: [{ modelVersion: "latest" }],
|
|
446
447
|
recognizePiiEntitiesActions: [{ modelVersion: "latest" }],
|
|
447
|
-
extractKeyPhrasesActions: [{ modelVersion: "latest" }]
|
|
448
|
+
extractKeyPhrasesActions: [{ modelVersion: "latest" }],
|
|
448
449
|
};
|
|
449
450
|
const poller = await client.beginAnalyzeActions(documents, actions);
|
|
450
451
|
const resultPages = await poller.pollUntilDone();
|