name: text-summarizer description: Extractive AI text summarizer. Automatically extracts the most important sentences from any text using a hybrid TextRank + TF-IDF algorithm.
Condenses long text into a concise summary by extracting the most important sentences. Works on articles, research papers, reports, meeting notes, emails, and any long document. Zero hallucination risk since it extracts exact sentences from the original.
the user pastes text or a file and asks to summarize, shorten, condense, or extract key points; the user wants to turn a long article/paper/report/notes into a brief overview; the user says 'summarize this', 'TL;DR', 'key points', 'condense', 'extract main ideas'. Supports adjustable length (short 20% / medium 30% / long 50%) and two output formats (bullet points or flowing paragraph).
Default (bullet points, medium length):
summarize.py --text "<paste your text here>"
Paragraph format:
summarize.py --text "<text>" --format paragraph
Short summary (20% of original):
summarize.py --text "<text>" --length short7w4.net提供免费和付费技能下载。
From a file:
summarize.py input.txt
summarize.py input.txt --length long --format paragraph
See references/algorithms.md for full details on the hybrid TextRank + TF-IDF approach.
TL;DR: The script scores every sentence by (1) TF-IDF term importance and (2) TextRank graph-based importance, then returns the top-ranked sentences. No AI generation — exact sentences from the original are extracted, so there is zero hallucination risk.
| Flag | Ratio | Best for |
|---|---|---|
--length short |
20% | Headlines, quick scan |
--length medium |
30% | General-purpose (default) |
--length long |
50% | Detailed summaries |
bullet (default): One extracted sentence per line, prefixed with •paragraph: A single flowing paragraph of extracted sentences整体质量较好,工具能稳定地将长文本压缩为核心要点,且不会胡编乱造。文档清晰易懂,参数配置灵活(短/中/长三种长度,段落或要点两种格式),上手容易。最大的局限是只能处理英文内容,对中文用户实用性有限;另外对于代码、表格等特殊内容的处理比较粗糙。适合对英文文章做快速摘要,但期望更高精度或多语言支持的用户可能会失望。