Table of Contents

Class VlmOcr.VlmOcrResult

Namespace
LMKit.Extraction.Ocr
Assembly
LM-Kit.NET.dll

Represents the detailed result of a vision-language OCR operation.

public sealed class VlmOcr.VlmOcrResult
Inheritance
VlmOcr.VlmOcrResult
Inherited Members

Examples

var ocr = new VlmOcr(model);
using var image = ImageBuffer.LoadAsRGB("page.png");
VlmOcr.VlmOcrResult result = ocr.Run(image);

// Access recognized text via the page element
Console.WriteLine(result.PageElement.Text);

// Access model-level metadata
Console.WriteLine($"Stop reason: {result.TextGeneration.StopReason}");

Remarks

This type exposes both the raw TextGenerationResult returned by the underlying model and the higher-level PageElement built from the generated text.

When RunAsync(OcrParameters, CancellationToken) is used, only the PageElement is surfaced via OcrResult. Callers that need direct access to model-level metadata (such as termination reasons or quality scores) can use Run(Attachment, int, CancellationToken) or RunAsync(Attachment, int, CancellationToken) to obtain a VlmOcr.VlmOcrResult instance.

Fields

PageElement

Gets the page representation constructed from the model’s completion.

TextGeneration

Gets the raw text generation result returned by the underlying language model.

Share