SentenceCompressor

Models & Types ยท AiDotNet.PromptEngineering.Compression

Compressor that shortens sentences while preserving their core meaning.

Inheritance: PromptCompressorBase โ†’ SentenceCompressor

For Beginners

Makes sentences shorter by keeping only the important parts.

Example:

What gets simplified:

  • Introductory phrases removed
  • Complex clauses simplified
  • Passive voice converted to active (when possible)

How It Works

This compressor analyzes sentence structure and removes non-essential clauses, qualifiers, and modifiers while maintaining grammatical correctness and the primary message.

Constructors

Constructor Summary
SentenceCompressor(Func<string, int> tokenCounter) Initializes a new instance of the SentenceCompressor class.