Skip to main content

Summarizer

A Summarizer creates a shorter version of a document’s content, helping users identify its main information without reading the entire text.

LogicalDOC supports two approaches:

  • LogicalDOC Summarizer: performs extractive summarization locally by selecting sentences from the original document.
  • ChatGPT Summarizer: uses an external AI API to generate a summary that can reformulate the document’s content.

LogicalDOC Summarizer

The LogicalDOC Summarizer combines a pre-trained MiniLM model with the Maximal Marginal Relevance (MMR) algorithm. MiniLM represents the meaning of sentences as numerical vectors, while MMR selects representative sentences and limits repetition.

This is an extractive summarizer: the summary contains complete sentences selected from the source document. Their wording is preserved, and they appear in their original document order.

How It Works

To obtain a summary of document, right-click on the specific document > Summary.

Summarizer
 

  1. The document’s text is divided into sentences. MiniLM converts each sentence into a 384-dimensional embedding representing its semantic meaning.
  2. The sentence embeddings are averaged to produce a centroid vector representing the document’s overall content.
  3. Each sentence’s relevance is calculated using its cosine similarity to the document centroid.
  4. Sentences are selected one at a time, balancing their relevance against their similarity to sentences already selected.
  5. The selected sentences are restored to their original order and combined into the final summary.

MiniLM does not write the summary. It supplies the semantic representations that MMR uses to choose which sentences to keep.

Configuration

The following properties control the LogicalDOC Summarizer.

Summarizer Settings
 

Model: Pre-trained MiniLM model in ONNX format, used to calculate sentence embeddings.
Sentences: Maximum number of sentences included in the summary. The default is 5.
Lambda: Controls the balance between relevance and avoiding repetition during MMR selection. The default is 0.7

Understanding Lambda

Lambda determines how much importance MMR gives to a sentence’s relevance compared with its similarity to sentences already selected.

  • Close to 1.0 - Prioritizes highly representative sentences, even when some contain similar information.
  • 0.7 (default) - Gives more importance to relevance while still penalizing repetition.
  • Around 0.5 - Gives similar importance to relevance and diversity.
  • Close to 0.0 - Strongly favors avoiding similar sentences, but may select less representative content.

ChatGPT Summarizer

The ChatGPT Summarizer uses the ChatGPT API to generate a summary of the document’s content. It follows a generative approach: the output can use new wording rather than reproduce sentences from the source.

Unlike the local LogicalDOC Summarizer, this approach requires communication with an external AI service. In order to use the ChatGPT Summarizer you need to add your OpenAI API Key in:  Tools > ChatGPT > Settings

Info

The MiniLM and MMR properties described above do not apply to the ChatGPT Summarizer.

Choosing a Summarizer

The LogicalDOC Summarizer uses an extractive approach, selecting representative sentences from the original document and preserving their wording. Processing takes place locally, using MiniLM to represent the meaning of sentences and MMR to select relevant content while limiting repetition.

The ChatGPT Summarizer uses a generative approach through the OpenAI API. It produces a summary that can reformulate the document’s content in new wording, rather than selecting existing sentences.

Choose the LogicalDOC Summarizer when you need local processing and a summary that preserves the source wording. Choose the ChatGPT Summarizer when you need a generated summary and can use an external AI service.