共用方式為


TextAnalysisClient.AnalyzeTextOperationStatusAsync Method

Definition

Overloads

AnalyzeTextOperationStatusAsync(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, RequestContext)

[Protocol Method] Get analysis status and results

AnalyzeTextOperationStatusAsync(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Get analysis status and results.

AnalyzeTextOperationStatusAsync(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, RequestContext)

Source:
TextAnalysisClient.cs

[Protocol Method] Get analysis status and results

public virtual System.Threading.Tasks.Task<Azure.Response> AnalyzeTextOperationStatusAsync (Guid jobId, bool? showStats, int? top, int? skip, Azure.RequestContext context);
abstract member AnalyzeTextOperationStatusAsync : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AnalyzeTextOperationStatusAsync : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AnalyzeTextOperationStatusAsync (jobId As Guid, showStats As Nullable(Of Boolean), top As Nullable(Of Integer), skip As Nullable(Of Integer), context As RequestContext) As Task(Of Response)

Parameters

jobId
Guid

job ID.

showStats
Nullable<Boolean>

(Optional) if set to true, response will contain request and document level statistics.

top
Nullable<Int32>

The maximum number of resources to return from the collection.

skip
Nullable<Int32>

An offset into the collection of the first resource to be returned.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null, null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString());

This sample shows how to call AnalyzeTextOperationStatusAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, 1234, 1234, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("nextLink").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString());

Applies to

AnalyzeTextOperationStatusAsync(Guid, Nullable<Boolean>, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Source:
TextAnalysisClient.cs

Get analysis status and results.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.Text.AnalyzeTextOperationState>> AnalyzeTextOperationStatusAsync (Guid jobId, bool? showStats = default, int? top = default, int? skip = default, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeTextOperationStatusAsync : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.Text.AnalyzeTextOperationState>>
override this.AnalyzeTextOperationStatusAsync : Guid * Nullable<bool> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.Text.AnalyzeTextOperationState>>
Public Overridable Function AnalyzeTextOperationStatusAsync (jobId As Guid, Optional showStats As Nullable(Of Boolean) = Nothing, Optional top As Nullable(Of Integer) = Nothing, Optional skip As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AnalyzeTextOperationState))

Parameters

jobId
Guid

job ID.

showStats
Nullable<Boolean>

(Optional) if set to true, response will contain request and document level statistics.

top
Nullable<Int32>

The maximum number of resources to return from the collection.

skip
Nullable<Int32>

An offset into the collection of the first resource to be returned.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call AnalyzeTextOperationStatusAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response<AnalyzeTextOperationState> response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"));

This sample shows how to call AnalyzeTextOperationStatusAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
TextAnalysisClient client = new TextAnalysisClient(endpoint, credential);

Response<AnalyzeTextOperationState> response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStats: true, top: 1234, skip: 1234);

Remarks

Get the status of an analysis job. A job can consist of one or more tasks. After all tasks succeed, the job transitions to the succeeded state and results are available for each task.

Applies to