Table of Contents

Interface IDocumentClassifier<T>

Namespace
AiDotNet.Document.Interfaces
Assembly
AiDotNet.dll

Interface for document classification models.

public interface IDocumentClassifier<T> : IDocumentModel<T>, IFullModel<T, Tensor<T>, Tensor<T>>, IModel<Tensor<T>, Tensor<T>, ModelMetadata<T>>, IModelSerializer, ICheckpointableModel, IParameterizable<T, Tensor<T>, Tensor<T>>, IFeatureAware, IFeatureImportance<T>, ICloneable<IFullModel<T, Tensor<T>, Tensor<T>>>, IGradientComputable<T, Tensor<T>, Tensor<T>>, IJitCompilable<T>

Type Parameters

T

The numeric type used for calculations.

Inherited Members
Extension Methods

Remarks

Document classification models categorize documents into predefined classes such as invoices, forms, letters, scientific papers, etc.

For Beginners: Document classification is like sorting mail into different piles. The model looks at a document and decides what type it is. This is useful for: - Organizing scanned documents - Routing documents to appropriate processing pipelines - Quality control in document processing

Example usage:

var classifier = new DocumentTypeClassifier<float>(architecture);
var result = classifier.ClassifyDocument(documentImage);
Console.WriteLine($"Document type: {result.PredictedCategory}");

Properties

AvailableCategories

Gets the available classification categories for this model.

IReadOnlyList<string> AvailableCategories { get; }

Property Value

IReadOnlyList<string>

Methods

ClassifyDocument(Tensor<T>)

Classifies a document image into predefined categories.

DocumentClassificationResult<T> ClassifyDocument(Tensor<T> documentImage)

Parameters

documentImage Tensor<T>

The document image tensor.

Returns

DocumentClassificationResult<T>

Classification result with predicted category and confidence.

ClassifyDocument(Tensor<T>, int)

Classifies a document and returns top-K predictions.

DocumentClassificationResult<T> ClassifyDocument(Tensor<T> documentImage, int topK)

Parameters

documentImage Tensor<T>

The document image tensor.

topK int

Number of top predictions to return.

Returns

DocumentClassificationResult<T>

Classification result with top-K predictions.