Skip to content

Commit

Permalink
[textanalytics] remove polling samples and fix snippets references in…
Browse files Browse the repository at this point in the history
… readme.md and AnalyzeBatchActions.md
  • Loading branch information
nsalem95 committed Feb 9, 2021
1 parent ca6a1ad commit 128bb05
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 299 deletions.
14 changes: 4 additions & 10 deletions sdk/textanalytics/Azure.AI.TextAnalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Text Analytics for health is a containerized service that extracts and labels re
### Run Analyze Operation Asynchronously
The Analyze functionality allows to choose which of the supported Text Analytics features to execute in the same set of documents. Currently the supported features are: entity recognition, key phrase extraction, and Personally Identifiable Information (PII) Recognition. For more information see [How to: Use Text Analytics for analyze operation][analyze_operation_howto].

```C# Snippet:AnalyzeOperationBatchConvenience
```C# Snippet:AnalyzeOperationBatchConvenienceAsync
string documentA = @"We love this trail and make the trip every year. The views are breathtaking and well
worth the hike! Yesterday was foggy though, so we missed the spectacular views.
We tried again today and it was amazing. Everyone in my family liked the trail although
Expand Down Expand Up @@ -517,17 +517,11 @@ The Analyze functionality allows to choose which of the supported Text Analytics
DisplayName = "AnalyzeOperationSample"
};

AnalyzeBatchActionsOperation operation = client.StartAnalyzeBatchActions(batchDocuments, batchActions);
AnalyzeBatchActionsOperation operation = await client.StartAnalyzeBatchActionsAsync(batchDocuments, batchActions);

TimeSpan pollingInterval = new TimeSpan(1000);
await operation.WaitForCompletionAsync();

while (!operation.HasCompleted)
{
Thread.Sleep(pollingInterval);
operation.UpdateStatus();
}

foreach (AnalyzeBatchActionsResult documentsInPage in operation.GetValues())
await foreach (AnalyzeBatchActionsResult documentsInPage in operation.Value)
{
RecognizeEntitiesResultCollection entitiesResult = documentsInPage.RecognizeEntitiesActionsResults.FirstOrDefault().Result;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(a

To run analyze operation in multiple documents, call `StartAnalyzeOperationBatchAsync` on an `IEnumerable` of strings. The result is a Long Running operation of type `AnalyzeOperation` which polls for the results from the API.

```C# Snippet:AnalyzeOperationBatchConvenience
```C# Snippet:AnalyzeOperationBatchConvenienceAsync
string documentA = @"We love this trail and make the trip every year. The views are breathtaking and well
worth the hike! Yesterday was foggy though, so we missed the spectacular views.
We tried again today and it was amazing. Everyone in my family liked the trail although
Expand Down Expand Up @@ -50,17 +50,11 @@ To run analyze operation in multiple documents, call `StartAnalyzeOperationBatch
DisplayName = "AnalyzeOperationSample"
};

AnalyzeBatchActionsOperation operation = client.StartAnalyzeBatchActions(batchDocuments, batchActions);
AnalyzeBatchActionsOperation operation = await client.StartAnalyzeBatchActionsAsync(batchDocuments, batchActions);

TimeSpan pollingInterval = new TimeSpan(1000);
await operation.WaitForCompletionAsync();

while (!operation.HasCompleted)
{
Thread.Sleep(pollingInterval);
operation.UpdateStatus();
}

foreach (AnalyzeBatchActionsResult documentsInPage in operation.GetValues())
await foreach (AnalyzeBatchActionsResult documentsInPage in operation.Value)
{
RecognizeEntitiesResultCollection entitiesResult = documentsInPage.RecognizeEntitiesActionsResults.FirstOrDefault().Result;

Expand Down Expand Up @@ -122,8 +116,8 @@ To see the full example source files, see:

* [Synchronously AnalyzeOperationBatch ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperation.cs)
* [Asynchronously AnalyzeOperationBatch ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync.cs)
* [Automatic Polling AnalyzeOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_AutomaticPolling.cs)
* [Manual Polling AnalyzeOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_ManualPolling.cs)
* [Synchronously AnalyzeBathActionsConvenience ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenience.cs)
* [Asynchronously AnalyzeBathActionsConvenience ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationBatchConvenienceAsync.cs)

[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/README.md
[README]: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ This method is for users who want to have intermittent code paths during the pol

To see the full example source files, see:

* [Automatic Polling AnalyzeOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_AutomaticPolling.cs)
* [Manual Polling AnalyzeOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync_ManualPolling.cs)
* [Automatic Polling AnalyzeOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperationAsync.cs)
* [Manual Polling AnalyzeOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_AnalyzeOperation.cs)
* [Automatic Polling HealthcareOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_AutomaticPolling.cs)
* [Manual Polling HealthcareOperation ](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/Sample_HealthcareAsync_ManualPolling.cs)

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task AnalyzeOperationBatchConvenienceAsync()

var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey));

#region Snippet:Sample_AnalyzeOperationBatchConvenienceAsync
#region Snippet:AnalyzeOperationBatchConvenienceAsync
string documentA = @"We love this trail and make the trip every year. The views are breathtaking and well
worth the hike! Yesterday was foggy though, so we missed the spectacular views.
We tried again today and it was amazing. Everyone in my family liked the trail although
Expand Down

0 comments on commit 128bb05

Please sign in to comment.