PostprocessorBase<T, TInput, TOutput>

Base Classes · AiDotNet.Postprocessing

Abstract base class for all postprocessors providing common functionality.

Implements: IPostprocessor<T, TInput, TOutput>

Known derived types: EntityLinking<T>, SpellCorrection<T>, StructuredOutputParser<T>, TextPostprocessor<T>

For Beginners

This is the foundation that all postprocessors build on. It provides common features like:

  • Configuration management
  • Batch processing support
  • Error handling

When creating a new postprocessor, you extend this class and implement the abstract methods.

How It Works

This class provides the template method pattern for postprocessing. Derived classes implement the core processing logic while this base class handles validation, configuration, and common operations.

Properties

Property Summary
bool IsConfigured { get; set; } Gets whether this postprocessor is configured and ready to use.
bool SupportsInverse { get; } Gets whether this postprocessor supports inverse transformation.

Methods

Method Summary
IList<TOutput> ProcessBatch(IEnumerable<TInput> inputs) Transforms a batch of model outputs.
TInput Inverse(TOutput output) Reverses the postprocessing (if supported).
TOutput Process(TInput input) Transforms model output into the final result format.
void Configure(Dictionary<string, object> settings) Configures the postprocessor with optional settings.