360 Secure SkillHub
360 安全技能中心

Text Summarizer

该 Skill 通过 TextRank 与 TF-IDF 对句子打分,从原文抽取重要句子生成摘要;支持直接文本或纯文本文件输入,可调短/中/长比例,并输出项目符号或段落。面向英文散文,代码、表格和结构化数据按纯文本处理,且仅支持单文档。

openlark
openlark
热度 86.73
最近更新 2026-05-11 17:43:14
分类:效率依赖:代码执行 / 读写文件应用场景:摘要总结

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add text-summarizer
Metadata
name
text-summarizer
description
Extractive AI text summarizer. Automatically extracts the most important sentences from any text using a hybrid TextRank + TF-IDF algorithm.

Text Summarizer

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.

Use Cases

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).

Quick Start

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 short

From a file:

summarize.py input.txt
summarize.py input.txt --length long --format paragraph

Algorithm

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.

Length Presets

Flag Ratio Best for
--length short 20% Headlines, quick scan
--length medium 30% General-purpose (default)
--length long 50% Detailed summaries

Output Formats

  • bullet (default): One extracted sentence per line, prefixed with •
  • paragraph: A single flowing paragraph of extracted sentences

What to Summarize

  • Articles and blog posts
  • Research papers and academic abstracts
  • Reports and white papers
  • Meeting notes and transcripts
  • Long email threads
  • Any prose document

Limitations

  • Optimized for English prose. Code, tables, and structured data are treated as plain text.
  • Returns original text unchanged if the input has 2 or fewer sentences.
  • Single-document only (one article at a time).