
text-summarizer
Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents.
- Installs
- 693
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill text-summarizer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads text-summarizer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Text Summarizer
Create concise summaries from long text documents using extractive summarization. Identifies and extracts the most important sentences while preserving meaning.
Quick Start
from scripts.text_summarizer import TextSummarizer
# Summarize text
summarizer = TextSummarizer()
summary = summarizer.summarize(long_text, ratio=0.2) # 20% of original
print(summary)
# Summarize file
summary = summarizer.summarize_file("article.txt", num_sentences=5)
Features
- Extractive Summarization: Selects key sentences from original text
- Length Control: By ratio, sentence count, or word count
- Multiple Algorithms: TextRank, LSA, frequency-based
- Key Points: Extract bullet-point summaries
- Batch Processing: Summarize multiple documents
- Preserve Structure: Maintains sentence order option
API Reference
Initialization
summarizer = TextSummarizer(
method="textrank", # textrank, lsa, frequency
language="english"
)
Summarization
# By ratio (20% of original length)
summary = summarizer.summarize(text, ratio=0.2)
# By sentence count
summary = summarizer.summarize(text, num_sentences=5)
# By word count
summary = summarizer.summarize(text, max_words=100)
Key Points Extraction
# Get bullet points
points = summarizer.extract_key_points(text, num_points=5)
for point in points:
print(f"• {point}")
Batch Processing
# Summarize multiple texts
texts = [text1, text2, text3]
summaries = summarizer.summarize_batch(texts, ratio=0.2)
# Summarize files in directory
summaries = summarizer.summarize_directory("./articles/", ratio=0.3)
Options
# Preserve original sentence order
summary = summarizer.summarize(text, preserve_order=True)
# Include title/first sentence
summary = summarizer.summarize(text, include_first=True)
# Minimum sentence length filter
summarizer.min_sentence_length = 10
CLI Usage
# Summarize text file
python text_summarizer.py --input article.txt --ratio 0.2
# Specific sentence count
python text_summarizer.py --input article.txt --sentences 5
# Extract key points
python text_summarizer.py --input article.txt --points 5
# Batch process
python text_summarizer.py --input-dir ./docs --output-dir ./summaries --ratio 0.3
# Output to file
python text_summarizer.py --input article.txt --output summary.txt --ratio 0.2
CLI Arguments
| Argument | Description | Default |
|---|---|---|
--input | Input file path | Required |
--output | Output file path | stdout |
--input-dir | Directory of files | - |
--output-dir | Output directory | - |
--ratio | Summary ratio (0.0-1.0) | 0.2 |
--sentences | Number of sentences | - |
--words | Maximum words | - |
--points | Extract N key points | - |
--method | Algorithm to use | textrank |
--preserve-order | Keep sentence order | False |
Examples
News Article Summary
summarizer = TextSummarizer()
article = """
[Long news article text...]
"""
# Get a 3-sentence summary
summary = summarizer.summarize(article, num_sentences=3)
print("Summary:")
print(summary)
# Get key points
points = summarizer.extract_key_points(article, num_points=5)
print("\nKey Points:")
for i, point in enumerate(points, 1):
print(f"{i}. {point}")
Research Paper Abstract
summarizer = TextSummarizer(method="lsa")
paper = open("research_paper.txt").read()
# Create abstract-length summary
abstract = summarizer.summarize(paper, max_words=250)
print(abstract)
Meeting Notes Summary
summarizer = TextSummarizer()
notes = """
Meeting started at 2pm. John presented Q3 results showing 15% growth.
Sarah raised concerns about supply chain delays affecting Q4 projections.
The team discussed mitigation strategies including dual-sourcing.
Budget allocation for marketing was approved at $50k.
Next steps include vendor outreach by Friday.
Follow-up meeting scheduled for next Tuesday.
"""
summary = summarizer.summarize(notes, num_sentences=3)
points = summarizer.extract_key_points(notes, num_points=4)
print("Summary:", summary)
print("\nAction Items:")
for point in points:
print(f"• {point}")
Batch Document Summarization
summarizer = TextSummarizer()
import os
for filename in os.listdir("./documents"):
if filename.endswith(".txt"):
text = open(f"./documents/{filename}").read()
summary = summarizer.summarize(text, ratio=0.2)
with open(f"./summaries/{filename}", "w") as f:
f.write(summary)
print(f"Summarized: {filename}")
Algorithm Comparison
| Algorithm | Speed | Quality | Best For |
|---|---|---|---|
| TextRank | Medium | High | General text |
| LSA | Fast | Good | Technical docs |
| Frequency | Fast | Medium | Quick summaries |
Dependencies
nltk>=3.8.0
numpy>=1.24.0
scikit-learn>=1.2.0
Limitations
- Extractive only (doesn't paraphrase or generate new text)
- Works best with well-structured text (paragraphs, clear sentences)
- Very short texts may not summarize well
- Doesn't understand context deeply (may miss nuance)
FAQ
What does the text-summarizer skill do?
Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents.
How do I install text-summarizer?
Run npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill text-summarizer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/text-summarizer/ (personal) or .claude/skills/text-summarizer/ (project).
Which AI agents can use text-summarizer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is text-summarizer safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains text-summarizer?
It is published by dkyazzentwatwa in dkyazzentwatwa/chatgpt-skills. It has 693 recorded installs.
More from dkyazzentwatwa/chatgpt-skills
ocr-document-processor
dkyazzentwatwa/chatgpt-skills
Extract text and structure from scans, images, and scanned PDFs. Use for OCR, searchable PDFs, table extraction, receipt parsing, and business card parsing.
crypto-ta-analyzer
dkyazzentwatwa/chatgpt-skills
Run multi-indicator technical analysis on crypto or market OHLCV data. Use for deterministic trend, momentum, volume, and divergence analysis.
financial-calculator
dkyazzentwatwa/chatgpt-skills
Run loan, investment, NPV, retirement, savings, and risk calculations with schedules and charts. Use for deterministic financial modeling tasks.
document-converter-suite
dkyazzentwatwa/chatgpt-skills
Convert PDFs, Office docs, markdown, HTML, and tables between editable formats. Use for best-effort document conversion, PDF utilities, form filling, and table extraction.
image-enhancement-suite
dkyazzentwatwa/chatgpt-skills
Open the skill to read its SKILL.md instructions.
svg-precision-skill
dkyazzentwatwa/chatgpt-skills
Open the skill to read its SKILL.md instructions.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.