Table of Contents

Class DocumentQAResult<T>

Namespace
AiDotNet.Document
Assembly
AiDotNet.dll

Represents the result of document question answering.

public class DocumentQAResult<T>

Type Parameters

T

The numeric type used for calculations.

Inheritance
DocumentQAResult<T>
Inherited Members

Remarks

For Beginners: When you ask a question about a document, the model returns an answer along with confidence information and optionally the evidence (where in the document the answer came from).

Properties

AlternativeAnswers

Gets alternative answers if multiple were considered.

public IReadOnlyList<AlternativeAnswer<T>>? AlternativeAnswers { get; init; }

Property Value

IReadOnlyList<AlternativeAnswer<T>>

Answer

Gets the answer to the question.

public string? Answer { get; init; }

Property Value

string

Confidence

Gets the confidence score for the answer (0-1).

public T Confidence { get; init; }

Property Value

T

ConfidenceLevel

Gets the classification of confidence level.

public ConfidenceLevel ConfidenceLevel { get; }

Property Value

ConfidenceLevel

ConfidenceValue

Gets the confidence as a double value for comparison.

public double ConfidenceValue { get; init; }

Property Value

double

Evidence

Gets the evidence regions that support the answer.

public IReadOnlyList<EvidenceRegion<T>>? Evidence { get; init; }

Property Value

IReadOnlyList<EvidenceRegion<T>>

Remarks

Evidence regions highlight where in the document the answer was found. This helps verify the answer and understand the model's reasoning.

HasAnswer

Gets whether the model was able to find an answer.

public bool HasAnswer { get; }

Property Value

bool

NoAnswerSentinel

Gets the sentinel string used when a model has no answer.

public static string NoAnswerSentinel { get; }

Property Value

string

ProcessingTimeMs

Gets processing time in milliseconds.

public double ProcessingTimeMs { get; init; }

Property Value

double

Question

Gets the original question that was asked.

public string Question { get; init; }

Property Value

string