Table of Contents

Method DetectAsync

Namespace
LMKit.TextAnalysis
Assembly
LM-Kit.NET.dll

DetectAsync(Attachment, string, OcrEngine, PiiPatternKinds, CancellationToken)

Asynchronously detects identifiers in a document and reports them as entities with their occurrences: page index and bounding box on the page.

public static Task<List<PiiExtraction.PiiExtractedEntity>> DetectAsync(Attachment content, string pageRange = null, OcrEngine ocrEngine = null, PiiPatternKinds kinds = PiiPatternKinds.All, CancellationToken cancellationToken = default)

Parameters

content Attachment

The document or image to scan.

pageRange string

A page range using 1-based page numbers (e.g. "1-5, 7"). null, empty or "*" scans every page.

ocrEngine OcrEngine

An optional OCR engine reading the pages that carry no text layer (scans); without it such pages yield nothing.

kinds PiiPatternKinds

The detectors to run. Default: all of them.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<List<PiiExtraction.PiiExtractedEntity>>

One entity per distinct identifier, each with a confidence of 1.

Exceptions

ArgumentNullException

content is null.

Share