Class DocumentSegment
- Namespace
- LMKit.Extraction
- Assembly
- LM-Kit.NET.dll
Represents a single logical document detected within a multi-page file, defined by its page range.
public sealed class DocumentSegment
- Inheritance
-
DocumentSegment
- Inherited Members
Examples
// Iterate segments returned by DocumentSplitting
foreach (DocumentSegment segment in result.Segments)
{
Console.WriteLine($"Pages {segment.StartPage}-{segment.EndPage}: {segment.Label}");
Console.WriteLine($" Page count: {segment.PageCount}");
}
Remarks
A DocumentSegment describes a contiguous range of pages that belong to the same logical document. Page numbers are 1-based and inclusive on both ends.
Instances of this class are produced by the DocumentSplitting class and returned inside a DocumentSplittingResult.
Properties
- EndPage
Gets the 1-based page number where this document segment ends (inclusive).
- Label
Gets the descriptive label assigned by the language model for this document segment (e.g., "Invoice", "Cover Letter", "Contract").
- PageCount
Gets the number of pages in this segment.
- StartPage
Gets the 1-based page number where this document segment starts (inclusive).
Methods
- ToString()
Returns a human-readable representation of this segment.