\"algo-nlp-summarization\"

SkillDocs & knowledge

A skill that lets your AI condense long documents into shorter summaries. Once added, it can pull out key points or rewrite content in condensed form, and it can compare different summarization approaches when you want to pick the best fit.

Available today. Use it from your connected AI after setup.

Add the skill, then ask your AI to summarize a document, give you a TLDR, or extract key points.

Then ask your AI: use the \"algo-nlp-summarization\" skill

What your AI can do with it

  • Condense long documents into short summaries
  • Extract the key points from a text
  • Produce TLDR versions of lengthy content
  • Rewrite text using abstractive summarization
  • Compare extractive and abstractive summarization strategies
  • Build an automatic summarization pipeline

What this skill tells your AI

The instructions your AI receives, as published by charlieviettq/awesome-agent-skill in .claude/skills/algo-nlp-summarization/SKILL.md and read by ahel’s review.

Overview

Text summarization condenses documents while preserving key information. Extractive: selects and concatenates important sentences from the original. Abstractive: generates new text that paraphrases the content. Extractive is simpler and more faithful; abstractive is more fluent but may hallucinate.

When to Use

Trigger conditions:

  • Condensing long documents, reports, or article collections
  • Building automated summary pipelines for content curation
  • Comparing extractive vs abstractive approaches for a use case

When NOT to use:

  • When full document understanding is needed (summarization loses detail)
  • For structured data extraction (use NER or information extraction)

Algorithm

IRON LAW: Abstractive Summarization Can HALLUCINATE
Abstractive models may generate fluent text containing facts NOT in
the source. Always verify key claims in abstractive summaries against
the original document. For high-stakes use cases (legal, medical),
prefer extractive or use abstractive with factual consistency checking.

Phase 1: Input Validation

Determine: input length, target summary length (ratio or word count), single-doc vs multi-doc, domain. Gate: Input text available, target length defined.

Phase 2: Core Algorithm

Extractive (TextRank/LexRank):

  1. Split document into sentences
  2. Build similarity graph (sentence nodes, cosine similarity edges)
  3. Run PageRank on sentence graph
  4. Select top-k sentences by rank, reorder by original position

Abstractive (transformer-based):

  1. Use pre-trained model (BART, T5, Pegasus)
  2. Encode input document (handle length limits with chunking if needed)
  3. Generate summary with beam search
  4. Post-process: check for repetition, factual consistency

Phase 3: Verification

Evaluate: ROUGE scores (ROUGE-1, ROUGE-2, ROUGE-L) against reference summaries. Manual check for factual accuracy and coherence. Gate: ROUGE scores reasonable for domain, no hallucinations in spot-check.

Phase 4: Output

Return summary with metadata.

Output Format

{
  "summary": "The company reported Q4 revenue of...",
  "method": "extractive_textrank",
  "metadata": {"input_words": 2000, "summary_words": 200, "compression_ratio": 0.10, "sentences_selected": 5}
}

Examples

Sample I/O

Input: 2000-word news article about quarterly earnings Expected: 200-word summary covering: revenue, profit, guidance, key highlights. Extractive: 5-6 selected sentences. Abstractive: coherent paragraph.

Edge Cases

InputExpectedWhy
Very short input (< 100 words)Return as-is or minimal trimmingAlready concise
Multiple contradicting sectionsSummary may miss nuanceSummarization favors dominant theme
Technical jargonExtractive preserves, abstractive may simplifyDomain expertise affects quality

Gotchas

  • ROUGE ≠ quality: ROUGE measures n-gram overlap with references. A high-ROUGE summary can be incoherent, and a low-ROUGE summary can be excellent with different word choices.
  • Input length limits: Transformer models have max token limits (512-4096). Long documents need chunking strategies (chunk-then-summarize or hierarchical summarization).
  • Repetition: Abstractive models sometimes repeat phrases. Use repetition penalty during generation (no_repeat_ngram_size).
  • Position bias: In news text, important information is front-loaded (inverted pyramid). Simple "take first N sentences" is a strong extractive baseline.
  • Multi-document summarization: Summarizing multiple related documents requires handling redundancy and contradiction across sources.

References

  • For TextRank/LexRank implementation details, see references/graph-based-extraction.md
  • For factual consistency checking, see references/factual-consistency.md

Signals

GitHub stars
26
Forks
9
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
algo-nlp-summarization
Source
github.com/charlieviettq/awesome-agent-skill