Table of Contents

Method Extract

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

Extract(Attachment, CancellationToken)

Synchronously recognizes PII in the given attachment. For multi-page documents (e.g. PDF), all pages are analyzed.

public List<PiiExtraction.PiiExtractedEntity> Extract(Attachment content, CancellationToken cancellationToken = default)

Parameters

content Attachment

The attachment to analyze. Can be an image or a multi-page document.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

List<PiiExtraction.PiiExtractedEntity>

A list of detected PiiExtraction.PiiExtractedEntity instances.

Exceptions

ArgumentNullException

Thrown when the attachment is null.

InvalidModelException

Thrown when the underlying language model does not support the required inference modality.

Extract(Attachment, string, CancellationToken)

Synchronously recognizes PII in the specified page range of the given attachment.

public List<PiiExtraction.PiiExtractedEntity> Extract(Attachment content, string pageRange, CancellationToken cancellationToken = default)

Parameters

content Attachment

The attachment to analyze. Can be an image or a multi-page document.

pageRange string

A page range string using 1-based page numbers (e.g., "1-5, 7, 9-12"). If null, empty, or "*", all pages are analyzed.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

List<PiiExtraction.PiiExtractedEntity>

A list of detected PiiExtraction.PiiExtractedEntity instances.

Exceptions

ArgumentNullException

Thrown when the attachment is null.

InvalidModelException

Thrown when the underlying language model does not support the required inference modality.

Extract(string, CancellationToken)

Synchronously recognizes PII in the given content.

public List<PiiExtraction.PiiExtractedEntity> Extract(string content, CancellationToken cancellationToken = default)

Parameters

content string
cancellationToken CancellationToken

Returns

List<PiiExtraction.PiiExtractedEntity>
Share