Skip to content

Commit 77e546a

Browse files
committed
Merge branch 'master' of https://github.com/aahill/azure-docs-pr
2 parents 609bf06 + ad79b12 commit 77e546a

File tree

1 file changed

+24
-30
lines changed
  • articles/cognitive-services/text-analytics/includes/quickstarts

1 file changed

+24
-30
lines changed

articles/cognitive-services/text-analytics/includes/quickstarts/nodejs-sdk.md

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.reviewer: sumeh, assafi
1313

1414
<a name="HOLTop"></a>
1515

16-
#### [Version 3.0-preview](#tab/version-3)
16+
#### [Version 3.0](#tab/version-3)
1717

1818
[v3 Reference documentation](https://aka.ms/azsdk-js-textanalytics-ref-docs) | [v3 Library source code](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics) | [v3 Package (NPM)](https://www.npmjs.com/package/@azure/ai-text-analytics) | [v3 Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples)
1919

@@ -51,12 +51,12 @@ npm init
5151
```
5252
### Install the client library
5353

54-
#### [Version 3.0-preview](#tab/version-3)
54+
#### [Version 3.0](#tab/version-3)
5555

5656
Install the `@azure/ai-text-analytics` NPM packages:
5757

5858
```console
59-
npm install --save @azure/[email protected].4
59+
npm install --save @azure/[email protected].5
6060
```
6161

6262
> [!TIP]
@@ -78,7 +78,7 @@ npm install --save @azure/cognitiveservices-textanalytics
7878
Your app's `package.json` file will be updated with the dependencies.
7979
Create a file named `index.js` and add the following:
8080

81-
#### [Version 3.0-preview](#tab/version-3)
81+
#### [Version 3.0](#tab/version-3)
8282

8383
```javascript
8484
"use strict";
@@ -123,7 +123,7 @@ The response object is a list containing the analysis information for each docum
123123

124124
## Client Authentication
125125

126-
#### [Version 3.0-preview](#tab/version-3)
126+
#### [Version 3.0](#tab/version-3)
127127

128128
Create a new `TextAnalyticsClient` object with your key and endpoint as parameters.
129129

@@ -141,7 +141,7 @@ Create a new [TextAnalyticsClient](https://docs.microsoft.com/javascript/api/@az
141141

142142
## Sentiment analysis
143143

144-
#### [Version 3.0-preview](#tab/version-3)
144+
#### [Version 3.0](#tab/version-3)
145145

146146
Create an array of strings containing the document you want to analyze. Call the client's `analyzeSentiment()` method and get the returned `SentimentBatchResult` object. Iterate through the list of results, and print each document's ID, document level sentiment with confidence scores. For each document, result contains sentence level sentiment along with offsets, length, and confidence scores.
147147

@@ -208,7 +208,7 @@ Run your code with `node index.js` in your console window.
208208

209209
## Language detection
210210

211-
#### [Version 3.0-preview](#tab/version-3)
211+
#### [Version 3.0](#tab/version-3)
212212

213213
Create an array of strings containing the document you want to analyze. Call the client's `detectLanguage()` method and get the returned `DetectLanguageResultCollection`. Then iterate through the results, and print each document's ID with respective primary language.
214214

@@ -257,7 +257,7 @@ Document ID: 3 , Language: Chinese_Simplified
257257

258258
## Named Entity Recognition (NER)
259259

260-
#### [Version 3.0-preview](#tab/version-3)
260+
#### [Version 3.0](#tab/version-3)
261261

262262
> [!NOTE]
263263
> In version `3.0-preview`:
@@ -278,7 +278,7 @@ async function entityRecognition(client){
278278
console.log(`Document ID: ${document.id}`);
279279
document.entities.forEach(entity => {
280280
console.log(`\tName: ${entity.text} \tCategory: ${entity.category} \tSubcategory: ${entity.subCategory ? entity.subCategory : "N/A"}`);
281-
console.log(`\tScore: ${entity.score}`);
281+
console.log(`\tScore: ${entity.confidenceScore}`);
282282
});
283283
});
284284
}
@@ -292,26 +292,20 @@ Run your code with `node index.js` in your console window.
292292
```console
293293
Document ID: 0
294294
Name: Microsoft Category: Organization Subcategory: N/A
295-
Score: 1
295+
Score: 0.29
296296
Name: Bill Gates Category: Person Subcategory: N/A
297-
Score: 0.67
297+
Score: 0.78
298298
Name: Paul Allen Category: Person Subcategory: N/A
299-
Score: 0.81
299+
Score: 0.82
300300
Name: April 4, 1975 Category: DateTime Subcategory: Date
301301
Score: 0.8
302-
Name: interpreters Category: PersonType Subcategory: N/A
303-
Score: 0.6
304302
Name: 8800 Category: Quantity Subcategory: Number
305303
Score: 0.8
306304
Document ID: 1
307-
Name: Microsoft Category: Organization Subcategory: N/A
308-
Score: 0.96
309-
Name: Redmond Category: Location Subcategory: GPE
310-
Score: 0.09
311305
Name: 21 Category: Quantity Subcategory: Number
312306
Score: 0.8
313307
Name: Seattle Category: Location Subcategory: GPE
314-
Score: 0.31
308+
Score: 0.25
315309
```
316310

317311
## Entity Linking
@@ -332,8 +326,8 @@ async function linkedEntityRecognition(client){
332326
console.log(`\tName: ${entity.name} \tID: ${entity.dataSourceEntityId} \tURL: ${entity.url} \tData Source: ${entity.dataSource}`);
333327
console.log(`\tMatches:`)
334328
entity.matches.forEach(match => {
335-
console.log(`\t\tText: ${match.text} \tScore: ${match.score.toFixed(2)}`);
336-
});
329+
console.log(`\t\tText: ${match.text} \tScore: ${match.confidenceScore.toFixed(2)}`);
330+
})
337331
});
338332
});
339333
}
@@ -348,24 +342,24 @@ Run your code with `node index.js` in your console window.
348342
Document ID: 0
349343
Name: Altair 8800 ID: Altair 8800 URL: https://en.wikipedia.org/wiki/Altair_8800 Data Source: Wikipedia
350344
Matches:
351-
Text: Altair 8800 Score: 0.78
345+
Text: Altair 8800 Score: 0.88
352346
Name: Bill Gates ID: Bill Gates URL: https://en.wikipedia.org/wiki/Bill_Gates Data Source: Wikipedia
353347
Matches:
354-
Text: Bill Gates Score: 0.55
355-
Text: Gates Score: 0.55
348+
Text: Bill Gates Score: 0.63
349+
Text: Gates Score: 0.63
356350
Name: Paul Allen ID: Paul Allen URL: https://en.wikipedia.org/wiki/Paul_Allen Data Source: Wikipedia
357351
Matches:
358-
Text: Paul Allen Score: 0.53
352+
Text: Paul Allen Score: 0.60
359353
Name: Microsoft ID: Microsoft URL: https://en.wikipedia.org/wiki/Microsoft Data Source: Wikipedia
360354
Matches:
361-
Text: Microsoft Score: 0.47
362-
Text: Microsoft Score: 0.47
355+
Text: Microsoft Score: 0.55
356+
Text: Microsoft Score: 0.55
363357
Name: April 4 ID: April 4 URL: https://en.wikipedia.org/wiki/April_4 Data Source: Wikipedia
364358
Matches:
365-
Text: April 4 Score: 0.25
359+
Text: April 4 Score: 0.32
366360
Name: BASIC ID: BASIC URL: https://en.wikipedia.org/wiki/BASIC Data Source: Wikipedia
367361
Matches:
368-
Text: BASIC Score: 0.28
362+
Text: BASIC Score: 0.33
369363
```
370364

371365
#### [Version 2.1](#tab/version-2)
@@ -413,7 +407,7 @@ Document ID: 2
413407

414408
## Key phrase extraction
415409

416-
#### [Version 3.0-preview](#tab/version-3)
410+
#### [Version 3.0](#tab/version-3)
417411

418412
Create an array of strings containing the document you want to analyze. Call the client's `extractKeyPhrases()` method and get the returned `ExtractKeyPhrasesResult` object. Iterate through the results and print each document's ID, and any detected key phrases.
419413

0 commit comments

Comments
 (0)