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
contentAttachmentThe attachment to analyze. Can be an image or a multi-page document.
cancellationTokenCancellationTokenToken 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
contentAttachmentThe attachment to analyze. Can be an image or a multi-page document.
pageRangestringA page range string using 1-based page numbers (e.g.,
"1-5, 7, 9-12"). Ifnull, empty, or"*", all pages are analyzed.cancellationTokenCancellationTokenToken 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
contentstringcancellationTokenCancellationToken