Share via


TextAnalysisClient.AnalyzeTextSubmitOperation Method

Definition

Overloads

AnalyzeTextSubmitOperation(WaitUntil, RequestContent, RequestContext)

[Protocol Method] Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed as a long-running operation.

AnalyzeTextSubmitOperation(WaitUntil, MultiLanguageTextInput, IEnumerable<AnalyzeTextOperationAction>, String, String, CancellationToken)

Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed as a long-running operation.

AnalyzeTextSubmitOperation(WaitUntil, RequestContent, RequestContext)

[Protocol Method] Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed as a long-running operation.

public virtual Azure.Operation AnalyzeTextSubmitOperation (Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AnalyzeTextSubmitOperation : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation
override this.AnalyzeTextSubmitOperation : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation
Public Overridable Function AnalyzeTextSubmitOperation (waitUntil As WaitUntil, content As RequestContent, Optional context As RequestContext = Nothing) As Operation

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

content
RequestContent

The content to send as the body of the request.

context
RequestContext

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

Returns

The Operation representing an asynchronous operation on the service.

Exceptions

content is null.

Service returned a non-success status code.

Examples

This sample shows how to call AnalyzeTextSubmitOperation.

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

using RequestContent content = RequestContent.Create(new
{
    analysisInput = new object(),
    tasks = new object[]
    {
        new
        {
            kind = "CustomEntityRecognition",
        }
    },
});
Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeTextSubmitOperation with all parameters and request content.

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

using RequestContent content = RequestContent.Create(new
{
    displayName = "<displayName>",
    analysisInput = new
    {
        documents = new object[]
        {
            new
            {
                id = "<id>",
                text = "<text>",
                language = "<language>",
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            kind = "CustomEntityRecognition",
            parameters = new
            {
                loggingOptOut = true,
                projectName = "<projectName>",
                deploymentName = "<deploymentName>",
                stringIndexType = "TextElements_v8",
            },
            taskName = "<taskName>",
        }
    },
    defaultLanguage = "<defaultLanguage>",
});
Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content);

Applies to

AnalyzeTextSubmitOperation(WaitUntil, MultiLanguageTextInput, IEnumerable<AnalyzeTextOperationAction>, String, String, CancellationToken)

Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed as a long-running operation.

public virtual Azure.Operation AnalyzeTextSubmitOperation (Azure.WaitUntil waitUntil, Azure.AI.Language.Text.MultiLanguageTextInput textInput, System.Collections.Generic.IEnumerable<Azure.AI.Language.Text.AnalyzeTextOperationAction> actions, string displayName = default, string defaultLanguage = default, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeTextSubmitOperation : Azure.WaitUntil * Azure.AI.Language.Text.MultiLanguageTextInput * seq<Azure.AI.Language.Text.AnalyzeTextOperationAction> * string * string * System.Threading.CancellationToken -> Azure.Operation
override this.AnalyzeTextSubmitOperation : Azure.WaitUntil * Azure.AI.Language.Text.MultiLanguageTextInput * seq<Azure.AI.Language.Text.AnalyzeTextOperationAction> * string * string * System.Threading.CancellationToken -> Azure.Operation
Public Overridable Function AnalyzeTextSubmitOperation (waitUntil As WaitUntil, textInput As MultiLanguageTextInput, actions As IEnumerable(Of AnalyzeTextOperationAction), Optional displayName As String = Nothing, Optional defaultLanguage As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Operation

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

textInput
MultiLanguageTextInput

Contains the input to be analyzed.

actions
IEnumerable<AnalyzeTextOperationAction>

List of tasks to be performed as part of the LRO.

displayName
String

Name for the task.

defaultLanguage
String

Default language to use for records requesting automatic language detection.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

textInput or actions is null.

Examples

This sample shows how to call AnalyzeTextSubmitOperation.

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

MultiLanguageTextInput textInput = new MultiLanguageTextInput();
Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[]
{
    new CustomEntitiesOperationAction()
});

This sample shows how to call AnalyzeTextSubmitOperation with all parameters.

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

MultiLanguageTextInput textInput = new MultiLanguageTextInput
{
    MultiLanguageInputs = {new MultiLanguageInput("<id>", "<text>")
    {
        Language = "<language>",
    }},
};
Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[]
{
    new CustomEntitiesOperationAction
    {
        ActionContent = new CustomEntitiesActionContent("<projectName>", "<deploymentName>")
        {
            LoggingOptOut = true,
            StringIndexType = StringIndexType.TextElementsV8,
        },
        Name = "<taskName>",
    }
}, displayName: "<displayName>", defaultLanguage: "<defaultLanguage>");

Applies to