Skip to content

Commit a83eb41

Browse files
committed
Remove Offsets from display output - these will be keptout until a later release
1 parent d1f7a98 commit a83eb41

File tree

1 file changed

+19
-18
lines changed
  • articles/cognitive-services/text-analytics/includes/quickstarts

1 file changed

+19
-18
lines changed

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static void SentimentAnalysisExample(TextAnalyticsClient client)
165165
var si = new StringInfo(inputText);
166166
foreach (var sentence in documentSentiment.Sentences)
167167
{
168-
Console.WriteLine($"\tSentence [offset {sentence.GraphemeOffset}, length {sentence.GraphemeLength}]");
168+
Console.WriteLine($"\tSentence [length {sentence.GraphemeLength}]");
169169
Console.WriteLine($"\tText: \"{si.SubstringByTextElements(sentence.GraphemeOffset, sentence.GraphemeLength)}\"");
170170
Console.WriteLine($"\tSentence sentiment: {sentence.Sentiment}");
171171
Console.WriteLine($"\tPositive score: {sentence.ConfidenceScores.Positive:0.00}");
@@ -180,14 +180,14 @@ static void SentimentAnalysisExample(TextAnalyticsClient client)
180180
```console
181181
Document sentiment: Positive
182182

183-
Sentence [offset 0, length 30]
183+
Sentence [length 30]
184184
Text: "I had the best day of my life."
185185
Sentence sentiment: Positive
186186
Positive score: 1.00
187187
Negative score: 0.00
188188
Neutral score: 0.00
189189

190-
Sentence [offset 31, length 30]
190+
Sentence [length 30]
191191
Text: "I wish you were there with me."
192192
Sentence sentiment: Neutral
193193
Positive score: 0.21
@@ -267,13 +267,14 @@ Create a new function called `EntityRecognitionExample()` that takes the client
267267

268268
```csharp
269269
static void EntityRecognitionExample(TextAnalyticsClient client)
270+
static void EntityRecognitionExample(TextAnalyticsClient client)
270271
{
271272
var response = client.RecognizeEntities("I had a wonderful trip to Seattle last week.");
272273
Console.WriteLine("Named Entities:");
273274
foreach (var entity in response.Value)
274275
{
275276
Console.WriteLine($"\tText: {entity.Text},\tCategory: {entity.Category},\tSub-Category: {entity.SubCategory}");
276-
Console.WriteLine($"\t\tOffset: {entity.GraphemeOffset},\tLength: {entity.GraphemeLength},\tScore: {entity.ConfidenceScore:F2}\n");
277+
Console.WriteLine($"\t\tLength: {entity.GraphemeLength},\tScore: {entity.ConfidenceScore:F2}\n");
277278
}
278279
}
279280
```
@@ -283,10 +284,10 @@ static void EntityRecognitionExample(TextAnalyticsClient client)
283284
```console
284285
Named Entities:
285286
Text: Seattle, Category: Location, Sub-Category: GPE
286-
Offset: 26, Length: 7, Score: 0.92
287+
Length: 7, Score: 0.92
287288

288289
Text: last week, Category: DateTime, Sub-Category: DateRange
289-
Offset: 34, Length: 9, Score: 0.80
290+
Length: 9, Score: 0.80
290291
```
291292

292293
## Detect personal information
@@ -302,7 +303,7 @@ static void EntityPIIExample(TextAnalyticsClient client)
302303
foreach (var entity in response.Value)
303304
{
304305
Console.WriteLine($"\tText: {entity.Text},\tCategory: {entity.Category},\tSub-Category: {entity.SubCategory}");
305-
Console.WriteLine($"\t\tOffset: {entity.GraphemeOffset},\tLength: {entity.GraphemeLength},\tScore: {entity.ConfidenceScore:F2}\n");
306+
Console.WriteLine($"\t\tLength: {entity.GraphemeLength},\tScore: {entity.ConfidenceScore:F2}\n");
306307
}
307308
}
308309
```
@@ -311,8 +312,8 @@ static void EntityPIIExample(TextAnalyticsClient client)
311312

312313
```console
313314
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
316317
```
317318

318319

@@ -337,7 +338,7 @@ static void EntityLinkingExample(TextAnalyticsClient client)
337338
foreach (var match in entity.Matches)
338339
{
339340
Console.WriteLine($"\t\tText: {match.Text}");
340-
Console.WriteLine($"\t\tOffset: {match.GraphemeOffset},\tLength: {match.GraphemeLength},\tScore: {match.ConfidenceScore:F2}\n");
341+
Console.WriteLine($"\t\tLength: {match.GraphemeLength},\tScore: {match.ConfidenceScore:F2}\n");
341342
}
342343
}
343344
}
@@ -350,38 +351,38 @@ Linked Entities:
350351
Name: Altair 8800, ID: Altair 8800, URL: https://en.wikipedia.org/wiki/Altair_8800 Data Source: Wikipedia
351352
Matches:
352353
Text: Altair 8800
353-
Offset: 116, Length: 11, Score: 0.79
354+
Length: 11, Score: 0.78
354355

355356
Name: Bill Gates, ID: Bill Gates, URL: https://en.wikipedia.org/wiki/Bill_Gates Data Source: Wikipedia
356357
Matches:
357358
Text: Bill Gates
358-
Offset: 25, Length: 10, Score: 0.55
359+
Length: 10, Score: 0.55
359360

360361
Text: Gates
361-
Offset: 161, Length: 5, Score: 0.55
362+
Length: 5, Score: 0.55
362363

363364
Name: Paul Allen, ID: Paul Allen, URL: https://en.wikipedia.org/wiki/Paul_Allen Data Source: Wikipedia
364365
Matches:
365366
Text: Paul Allen
366-
Offset: 40, Length: 10, Score: 0.53
367+
Length: 10, Score: 0.53
367368

368369
Name: Microsoft, ID: Microsoft, URL: https://en.wikipedia.org/wiki/Microsoft Data Source: Wikipedia
369370
Matches:
370371
Text: Microsoft
371-
Offset: 0, Length: 9, Score: 0.47
372+
Length: 9, Score: 0.47
372373

373374
Text: Microsoft
374-
Offset: 150, Length: 9, Score: 0.47
375+
Length: 9, Score: 0.47
375376

376377
Name: April 4, ID: April 4, URL: https://en.wikipedia.org/wiki/April_4 Data Source: Wikipedia
377378
Matches:
378379
Text: April 4
379-
Offset: 54, Length: 7, Score: 0.25
380+
Length: 7, Score: 0.25
380381

381382
Name: BASIC, ID: BASIC, URL: https://en.wikipedia.org/wiki/BASIC Data Source: Wikipedia
382383
Matches:
383384
Text: BASIC
384-
Offset: 89, Length: 5, Score: 0.28
385+
Length: 5, Score: 0.28
385386
```
386387

387388
#### [Version 2.1](#tab/version-2)

0 commit comments

Comments
 (0)