@@ -165,7 +165,7 @@ 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 . GraphemeOffset }, length {sentence .GraphemeLength }]" );
168
+ Console .WriteLine ($" \t Sentence [length {sentence .GraphemeLength }]" );
169
169
Console .WriteLine ($" \t Text: \" {si .SubstringByTextElements (sentence .GraphemeOffset , sentence .GraphemeLength )}\" " );
170
170
Console .WriteLine ($" \t Sentence sentiment: {sentence .Sentiment }" );
171
171
Console .WriteLine ($" \t Positive score: {sentence .ConfidenceScores .Positive : 0 . 00 }" );
@@ -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
@@ -267,13 +267,14 @@ Create a new function called `EntityRecognitionExample()` that takes the client
267
267
268
268
``` csharp
269
269
static void EntityRecognitionExample (TextAnalyticsClient client )
270
+ static void EntityRecognitionExample (TextAnalyticsClient client )
270
271
{
271
272
var response = client .RecognizeEntities (" I had a wonderful trip to Seattle last week." );
272
273
Console .WriteLine (" Named Entities:" );
273
274
foreach (var entity in response .Value )
274
275
{
275
276
Console .WriteLine ($" \t Text: {entity .Text },\t Category: {entity .Category },\t Sub-Category: {entity .SubCategory }" );
276
- Console .WriteLine ($" \t\t Offset: { entity . GraphemeOffset }, \ t Length: {entity .GraphemeLength },\t Score: {entity .ConfidenceScore : F2 }\n " );
277
+ Console .WriteLine ($" \t\t Length: {entity .GraphemeLength },\t Score: {entity .ConfidenceScore : F2 }\n " );
277
278
}
278
279
}
279
280
```
@@ -283,10 +284,10 @@ static void EntityRecognitionExample(TextAnalyticsClient client)
283
284
``` console
284
285
Named Entities:
285
286
Text: Seattle, Category: Location, Sub-Category: GPE
286
- Offset: 26, Length: 7, Score: 0.92
287
+ Length: 7, Score: 0.92
287
288
288
289
Text: last week, Category: DateTime, Sub-Category: DateRange
289
- Offset: 34, Length: 9, Score: 0.80
290
+ Length: 9, Score: 0.80
290
291
```
291
292
292
293
## Detect personal information
@@ -302,7 +303,7 @@ static void EntityPIIExample(TextAnalyticsClient client)
302
303
foreach (var entity in response .Value )
303
304
{
304
305
Console .WriteLine ($" \t Text: {entity .Text },\t Category: {entity .Category },\t Sub-Category: {entity .SubCategory }" );
305
- Console .WriteLine ($" \t\t Offset: { entity . GraphemeOffset }, \ t Length: {entity .GraphemeLength },\t Score: {entity .ConfidenceScore : F2 }\n " );
306
+ Console .WriteLine ($" \t\t Length: {entity .GraphemeLength },\t Score: {entity .ConfidenceScore : F2 }\n " );
306
307
}
307
308
}
308
309
```
@@ -311,8 +312,8 @@ static void EntityPIIExample(TextAnalyticsClient client)
311
312
312
313
``` console
313
314
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.85
315
+ Text: 123-12-1234, Category: U.S. Social Security Number (SSN), Sub-Category:
316
+ Length: 11, Score: 0.85
316
317
```
317
318
318
319
@@ -337,7 +338,7 @@ static void EntityLinkingExample(TextAnalyticsClient client)
337
338
foreach (var match in entity .Matches )
338
339
{
339
340
Console .WriteLine ($" \t\t Text: {match .Text }" );
340
- Console .WriteLine ($" \t\t Offset: { match . GraphemeOffset }, \ t Length: {match .GraphemeLength },\t Score: {match .ConfidenceScore : F2 }\n " );
341
+ Console .WriteLine ($" \t\t Length: {match .GraphemeLength },\t Score: {match .ConfidenceScore : F2 }\n " );
341
342
}
342
343
}
343
344
}
@@ -350,38 +351,38 @@ Linked Entities:
350
351
Name: Altair 8800, ID: Altair 8800, URL: https://en.wikipedia.org/wiki/Altair_8800 Data Source: Wikipedia
351
352
Matches:
352
353
Text: Altair 8800
353
- Offset: 116, Length: 11, Score: 0.79
354
+ Length: 11, Score: 0.78
354
355
355
356
Name: Bill Gates, ID: Bill Gates, URL: https://en.wikipedia.org/wiki/Bill_Gates Data Source: Wikipedia
356
357
Matches:
357
358
Text: Bill Gates
358
- Offset: 25, Length: 10, Score: 0.55
359
+ Length: 10, Score: 0.55
359
360
360
361
Text: Gates
361
- Offset: 161, Length: 5, Score: 0.55
362
+ Length: 5, Score: 0.55
362
363
363
364
Name: Paul Allen, ID: Paul Allen, URL: https://en.wikipedia.org/wiki/Paul_Allen Data Source: Wikipedia
364
365
Matches:
365
366
Text: Paul Allen
366
- Offset: 40, Length: 10, Score: 0.53
367
+ Length: 10, Score: 0.53
367
368
368
369
Name: Microsoft, ID: Microsoft, URL: https://en.wikipedia.org/wiki/Microsoft Data Source: Wikipedia
369
370
Matches:
370
371
Text: Microsoft
371
- Offset: 0, Length: 9, Score: 0.47
372
+ Length: 9, Score: 0.47
372
373
373
374
Text: Microsoft
374
- Offset: 150, Length: 9, Score: 0.47
375
+ Length: 9, Score: 0.47
375
376
376
377
Name: April 4, ID: April 4, URL: https://en.wikipedia.org/wiki/April_4 Data Source: Wikipedia
377
378
Matches:
378
379
Text: April 4
379
- Offset: 54, Length: 7, Score: 0.25
380
+ Length: 7, Score: 0.25
380
381
381
382
Name: BASIC, ID: BASIC, URL: https://en.wikipedia.org/wiki/BASIC Data Source: Wikipedia
382
383
Matches:
383
384
Text: BASIC
384
- Offset: 89, Length: 5, Score: 0.28
385
+ Length: 5, Score: 0.28
385
386
```
386
387
387
388
#### [ Version 2.1] ( #tab/version-2 )
0 commit comments