Enum VlmOcrIntent
- Namespace
- LMKit.Extraction.Ocr
- Assembly
- LM-Kit.NET.dll
Specifies the desired outcome of a VlmOcr operation.
public enum VlmOcrIntent
Fields
Undefined = 0No explicit intent specified. The engine selects a default intent based on the loaded model: plain-text OCR for models that support it natively (for example, PaddleOCR-VL), Markdown conversion for general-purpose models.
PlainText = 1Extract text from the image as plain, unformatted text without any markup, coordinates, or structural annotations.
TableRecognition = 2Detect and extract tabular structures, preserving rows and columns.
FormulaRecognition = 3Recognize and transcribe mathematical formulas.
ChartRecognition = 4Interpret charts, graphs, and data visualizations.
OcrWithCoordinates = 5Extract text together with bounding-box coordinates for each detected region. The granularity follows the model's native spatial output: text lines for spotting models (for example, PaddleOCR-VL), layout blocks for document-parsing models (for example, Infinity-Parser2). When the model classifies regions, each element's Category carries the layout category.
SealRecognition = 6Recognize and transcribe stamps, seals, and similar graphical marks.
Markdown = 7Transcribe the page content as Markdown, preserving headings, lists, emphasis, and other structural elements.
LayoutAnalysis = 8Extract the full page structure as semantic layout elements: for each detected region, its bounding box, layout category (title, text, table, formula, figure, caption, footer, ...), and content, sorted in human reading order.
Unlike OcrWithCoordinates, which returns flat positioned text spans, this intent asks for a structural interpretation of the page. Element content is typed by category: tables carry HTML, formulas carry LaTeX, and every other category carries Markdown.
With models that natively support layout extraction (for example, Infinity-Parser2), the positioned regions populate the resulting page element with their layout category exposed through Category. Text-free regions (figures) are included with their bounding box and an empty text, so the complete page structure is surfaced. NormalizedText carries the machine-readable layout payload, a JSON array of
{"bbox": [x1, y1, x2, y2], "category": "...", "text": "..."}objects.
Examples
// Create a VlmOcr with an explicit intent
var ocr = new VlmOcr(model, VlmOcrIntent.TableRecognition);
// Query supported intents for a specific model
IReadOnlyList<VlmOcrIntent> intents = VlmOcr.GetSupportedIntents(model);
foreach (var intent in intents)
{
Console.WriteLine(intent);
}
Remarks
Each member represents a high-level intent describing what the caller expects from the OCR engine. Not every vision-language model natively supports every intent. The engine maps each intent to the best available instruction and post-processing strategy for the loaded model, applying all possible internal logic to reach the desired result.