Sdílet prostřednictvím


QuestionAnsweringClient.GetAnswersFromText Method

Definition

Overloads

GetAnswersFromText(AnswersFromTextOptions, CancellationToken)

Answers the specified question using the provided text in the body.

GetAnswersFromText(String, IEnumerable<TextDocument>, String, CancellationToken)

Answers the specified question using the text textDocuments.

GetAnswersFromText(String, IEnumerable<String>, String, CancellationToken)

Answers the specified question using the text textDocuments.

GetAnswersFromText(AnswersFromTextOptions, CancellationToken)

Source:
QuestionAnsweringClient.cs

Answers the specified question using the provided text in the body.

public virtual Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult> GetAnswersFromText (Azure.AI.Language.QuestionAnswering.AnswersFromTextOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswersFromText : Azure.AI.Language.QuestionAnswering.AnswersFromTextOptions * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>
override this.GetAnswersFromText : Azure.AI.Language.QuestionAnswering.AnswersFromTextOptions * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>
Public Overridable Function GetAnswersFromText (options As AnswersFromTextOptions, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AnswersFromTextResult)

Parameters

options
AnswersFromTextOptions

The question to answer.

cancellationToken
CancellationToken

An optional CancellationToken to cancel the request.

Returns

AnswersFromTextResult containing answers to the Question.

Exceptions

options is null.

The service returned an error. The exception contains details of the service error.

Applies to

GetAnswersFromText(String, IEnumerable<TextDocument>, String, CancellationToken)

Source:
QuestionAnsweringClient.cs

Answers the specified question using the text textDocuments.

public virtual Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult> GetAnswersFromText (string question, System.Collections.Generic.IEnumerable<Azure.AI.Language.QuestionAnswering.TextDocument> textDocuments, string language = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswersFromText : string * seq<Azure.AI.Language.QuestionAnswering.TextDocument> * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>
override this.GetAnswersFromText : string * seq<Azure.AI.Language.QuestionAnswering.TextDocument> * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>
Public Overridable Function GetAnswersFromText (question As String, textDocuments As IEnumerable(Of TextDocument), Optional language As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AnswersFromTextResult)

Parameters

question
String

The question to answer.

textDocuments
IEnumerable<TextDocument>

A collection of TextDocument to query.

language
String

The language of the text documents. This is the BCP-47 representation of a language. For example, use "en" for English, "es" for Spanish, etc. If not set, uses DefaultLanguage as the default. If DefaultLanguage is not set, the service default, "en" for English, is used. See https://docs.microsoft.com/azure/cognitive-services/qnamaker/overview/language-support for list of currently supported languages.

cancellationToken
CancellationToken

An optional CancellationToken to cancel the request.

Returns

AnswersFromTextResult containing answers to the question.

Exceptions

question or textDocuments is null.

The service returned an error. The exception contains details of the service error.

Applies to

GetAnswersFromText(String, IEnumerable<String>, String, CancellationToken)

Source:
QuestionAnsweringClient.cs

Answers the specified question using the text textDocuments.

public virtual Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult> GetAnswersFromText (string question, System.Collections.Generic.IEnumerable<string> textDocuments, string language = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnswersFromText : string * seq<string> * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>
override this.GetAnswersFromText : string * seq<string> * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Language.QuestionAnswering.AnswersFromTextResult>
Public Overridable Function GetAnswersFromText (question As String, textDocuments As IEnumerable(Of String), Optional language As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AnswersFromTextResult)

Parameters

question
String

The question to answer.

textDocuments
IEnumerable<String>

The text documents to query.

language
String

The language of the text documents. This is the BCP-47 representation of a language. For example, use "en" for English, "es" for Spanish, etc. If not set, uses DefaultLanguage as the default. If DefaultLanguage is not set, the service default, "en" for English, is used. See https://docs.microsoft.com/azure/cognitive-services/qnamaker/overview/language-support for list of currently supported languages.

cancellationToken
CancellationToken

An optional CancellationToken to cancel the request.

Returns

AnswersFromTextResult containing answers to the question.

Exceptions

question or textDocuments is null.

The service returned an error. The exception contains details of the service error.

Applies to