@@ -165,12 +165,12 @@ static void SentimentAnalysisExample(TextAnalyticsClient client)
165
165
var si = new StringInfo (inputText );
166
166
foreach (var sentence in documentSentiment .Sentences )
167
167
{
168
- Console .WriteLine ($" \t Sentence [offset { sentence . Offset }, length {sentence .Length }]" );
169
- Console .WriteLine ($" \t Text: \" {si .SubstringByTextElements (sentence .Offset , sentence .Length )}\" " );
168
+ Console .WriteLine ($" \t Sentence [length {sentence .GraphemeLength }]" );
169
+ Console .WriteLine ($" \t Text: \" {si .SubstringByTextElements (sentence .GraphemeOffset , sentence .GraphemeLength )}\" " );
170
170
Console .WriteLine ($" \t Sentence sentiment: {sentence .Sentiment }" );
171
- Console .WriteLine ($" \t Positive score: {sentence .SentimentScores .Positive : 0 . 00 }" );
172
- Console .WriteLine ($" \t Negative score: {sentence .SentimentScores .Negative : 0 . 00 }" );
173
- Console .WriteLine ($" \t Neutral score: {sentence .SentimentScores .Neutral : 0 . 00 }\n " );
171
+ Console .WriteLine ($" \t Positive score: {sentence .ConfidenceScores .Positive : 0 . 00 }" );
172
+ Console .WriteLine ($" \t Negative score: {sentence .ConfidenceScores .Negative : 0 . 00 }" );
173
+ Console .WriteLine ($" \t Neutral score: {sentence .ConfidenceScores .Neutral : 0 . 00 }\n " );
174
174
}
175
175
}
176
176
```
@@ -180,14 +180,14 @@ static void SentimentAnalysisExample(TextAnalyticsClient client)
180
180
``` console
181
181
Document sentiment: Positive
182
182
183
- Sentence [offset 0, length 30]
183
+ Sentence [length 30]
184
184
Text: "I had the best day of my life."
185
185
Sentence sentiment: Positive
186
186
Positive score: 1.00
187
187
Negative score: 0.00
188
188
Neutral score: 0.00
189
189
190
- Sentence [offset 31, length 30]
190
+ Sentence [length 30]
191
191
Text: "I wish you were there with me."
192
192
Sentence sentiment: Neutral
193
193
Positive score: 0.21
@@ -270,10 +270,10 @@ static void EntityRecognitionExample(TextAnalyticsClient client)
270
270
{
271
271
var response = client .RecognizeEntities (" I had a wonderful trip to Seattle last week." );
272
272
Console .WriteLine (" Named Entities:" );
273
- foreach (var entity in response .Value )
273
+ foreach (var entity in response .Value )
274
274
{
275
275
Console .WriteLine ($" \t Text: {entity .Text },\t Category: {entity .Category },\t Sub-Category: {entity .SubCategory }" );
276
- Console .WriteLine ($" \t\t Offset: { entity . Offset }, \ t Length: {entity .Length },\t Score: {entity .Score : F3 }\n " );
276
+ Console .WriteLine ($" \t\t Length: {entity .GraphemeLength },\t Score: {entity .ConfidenceScore : F2 }\n " );
277
277
}
278
278
}
279
279
```
@@ -283,10 +283,10 @@ static void EntityRecognitionExample(TextAnalyticsClient client)
283
283
``` console
284
284
Named Entities:
285
285
Text: Seattle, Category: Location, Sub-Category: GPE
286
- Offset: 26, Length: 7, Score: 0.920
286
+ Length: 7, Score: 0.92
287
287
288
288
Text: last week, Category: DateTime, Sub-Category: DateRange
289
- Offset: 34, Length: 9, Score: 0.800
289
+ Length: 9, Score: 0.80
290
290
```
291
291
292
292
## Detect personal information
@@ -299,10 +299,10 @@ static void EntityPIIExample(TextAnalyticsClient client)
299
299
string inputText = " Insurance policy for SSN on file 123-12-1234 is here by approved." ;
300
300
var response = client .RecognizePiiEntities (inputText );
301
301
Console .WriteLine (" Personally Identifiable Information Entities:" );
302
- foreach (var entity in response .Value )
302
+ foreach (var entity in response .Value )
303
303
{
304
304
Console .WriteLine ($" \t Text: {entity .Text },\t Category: {entity .Category },\t Sub-Category: {entity .SubCategory }" );
305
- Console .WriteLine ($" \t\t Offset: { entity . Offset }, \ t Length: {entity .Length },\t Score: {entity .Score : F3 }\n " );
305
+ Console .WriteLine ($" \t\t Length: {entity .GraphemeLength },\t Score: {entity .ConfidenceScore : F2 }\n " );
306
306
}
307
307
}
308
308
```
@@ -311,8 +311,8 @@ static void EntityPIIExample(TextAnalyticsClient client)
311
311
312
312
``` console
313
313
Personally Identifiable Information Entities:
314
- Text: 123-12-1234, Category: U.S. Social Security Number (SSN), Sub-Category: None
315
- Offset: 33, Length: 11, Score: 0.850
314
+ Text: 123-12-1234, Category: U.S. Social Security Number (SSN), Sub-Category:
315
+ Length: 11, Score: 0.85
316
316
```
317
317
318
318
@@ -332,12 +332,12 @@ static void EntityLinkingExample(TextAnalyticsClient client)
332
332
Console .WriteLine (" Linked Entities:" );
333
333
foreach (var entity in response .Value )
334
334
{
335
- Console .WriteLine ($" \t Name: {entity .Name },\t ID: {entity .Id },\t URL: {entity .Url }\t Data Source: {entity .DataSource }" );
335
+ Console .WriteLine ($" \t Name: {entity .Name },\t ID: {entity .DataSourceEntityId },\t URL: {entity .Url }\t Data Source: {entity .DataSource }" );
336
336
Console .WriteLine (" \t Matches:" );
337
337
foreach (var match in entity .Matches )
338
338
{
339
339
Console .WriteLine ($" \t\t Text: {match .Text }" );
340
- Console .WriteLine ($" \t\t Offset: { match . Offset }, \ t Length: {match .Length },\t Score: {match .Score : F3 }\n " );
340
+ Console .WriteLine ($" \t\t Length: {match .GraphemeLength },\t Score: {match .ConfidenceScore : F2 }\n " );
341
341
}
342
342
}
343
343
}
@@ -350,38 +350,38 @@ Linked Entities:
350
350
Name: Altair 8800, ID: Altair 8800, URL: https://en.wikipedia.org/wiki/Altair_8800 Data Source: Wikipedia
351
351
Matches:
352
352
Text: Altair 8800
353
- Offset: 116, Length: 11, Score: 0.777
353
+ Length: 11, Score: 0.78
354
354
355
355
Name: Bill Gates, ID: Bill Gates, URL: https://en.wikipedia.org/wiki/Bill_Gates Data Source: Wikipedia
356
356
Matches:
357
357
Text: Bill Gates
358
- Offset: 25, Length: 10, Score: 0.555
358
+ Length: 10, Score: 0.55
359
359
360
360
Text: Gates
361
- Offset: 161, Length: 5, Score: 0.555
361
+ Length: 5, Score: 0.55
362
362
363
363
Name: Paul Allen, ID: Paul Allen, URL: https://en.wikipedia.org/wiki/Paul_Allen Data Source: Wikipedia
364
364
Matches:
365
365
Text: Paul Allen
366
- Offset: 40, Length: 10, Score: 0.533
366
+ Length: 10, Score: 0.53
367
367
368
368
Name: Microsoft, ID: Microsoft, URL: https://en.wikipedia.org/wiki/Microsoft Data Source: Wikipedia
369
369
Matches:
370
370
Text: Microsoft
371
- Offset: 0, Length: 9, Score: 0.469
371
+ Length: 9, Score: 0.47
372
372
373
373
Text: Microsoft
374
- Offset: 150, Length: 9, Score: 0.469
374
+ Length: 9, Score: 0.47
375
375
376
376
Name: April 4, ID: April 4, URL: https://en.wikipedia.org/wiki/April_4 Data Source: Wikipedia
377
377
Matches:
378
378
Text: April 4
379
- Offset: 54, Length: 7, Score: 0.248
379
+ Length: 7, Score: 0.25
380
380
381
381
Name: BASIC, ID: BASIC, URL: https://en.wikipedia.org/wiki/BASIC Data Source: Wikipedia
382
382
Matches:
383
383
Text: BASIC
384
- Offset: 89, Length: 5, Score: 0.281
384
+ Length: 5, Score: 0.28
385
385
```
386
386
387
387
#### [ Version 2.1] ( #tab/version-2 )
0 commit comments