Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sumy is a free, open-source Python package and command-line tool for extractive text summarization. It ranks and selects sentences from plain text, local files, or HTML rather than generating rewritten prose. The current PyPI release observed on August 18, 2026 is Sumy 0.12.0, which requires Python 3.8 or newer. Install it locally, choose among eight classical algorithms, and keep source-level traceability without an API key or cloud account.

What automated summarization means

Extractive summarization selects sentences (or sentence fragments) already present in a document. Abstractive summarization generates new wording, usually with a language model. Sumy is primarily an extractive, single-document toolkit: it is designed to condense one document, not synthesize evidence across a collection or rewrite text in a requested style.

That distinction explains both its appeal and its limits. Selected sentences are easy to compare with the source and can run offline, but Sumy will not reliably resolve pronouns, reconcile contradictions, or explain facts spread across several sentences.

What the Sumy library provides

  • Python API and a command-line interface.
  • Plain-text, local-file, and HTML parsing.
  • Sentence-count and percentage-based summary lengths.
  • Eight classical summarizers: Luhn, Edmundson, LSA, LexRank, TextRank, SumBasic, KL-Sum, and Reduction.
  • A sumy_eval utility for comparing output with a reference summary.
  • Apache License 2.0 metadata and local execution without a mandatory subscription or API key.

See the PyPI package page and the official repository for release-specific details. The package classifiers list numerous languages, but tokenizer, stemming, stop-word coverage, and practical quality vary by language and version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Install Sumy

Use Python 3.8 or newer for the current package metadata:

python --version
python -m pip install sumy

The project also documents uv and a Git installation:

uv pip install sumy
uv pip install git+https://github.com/miso-belica/sumy.git

Verify the command-line entry point:

sumy --help

If the command is missing, activate the virtual environment that received the installation or call the executable from that environment’s binary directory. Do not name your application sumy.py or create a local directory named sumy; either can shadow the installed package.

Your first Sumy summarizer

from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummarizer
from sumy.nlp.stemmers import Stemmer
from sumy.utils import get_stop_words

LANGUAGE = "english"
SENTENCES_COUNT = 3

text = """
Python is a widely used programming language. It is popular for automation,
web development, data analysis, and machine learning. Its large ecosystem
contains libraries for many different tasks. Developers often choose Python
because its syntax is relatively easy to read and its community is large.
"""

parser = PlaintextParser.from_string(text, Tokenizer(LANGUAGE))
stemmer = Stemmer(LANGUAGE)
summarizer = LsaSummarizer(stemmer)
summarizer.stop_words = get_stop_words(LANGUAGE)

for sentence in summarizer(parser.document, SENTENCES_COUNT):
    print(sentence)

Tokenizer determines sentence and word boundaries. The optional Stemmer and stop-word list help LSA compare related terms. The summarizer returns sentence objects; iterating over them prints the selected source sentences.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Summarize a local text file

from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer

parser = PlaintextParser.from_file("article.txt", Tokenizer("english"))
summarizer = LexRankSummarizer()

for sentence in summarizer(parser.document, 5):
    print(sentence)
  • Normalize files to UTF-8 when you preprocess them.
  • Reject empty or near-empty input before calling the algorithm.
  • Keep original sentence positions if you need audit trails or later reordering.
  • Escape or sanitize generated output before inserting it into HTML.

Summarize an HTML page

from sumy.parsers.html import HtmlParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer

parser = HtmlParser.from_url(
    "https://example.com/article",
    Tokenizer("english")
)
summarizer = LexRankSummarizer()

for sentence in summarizer(parser.document, 5):
    print(sentence)

URL parsing is not a full article-extraction system. Navigation, cookie notices, comments, advertisements, malformed markup, client-side rendering, login walls, rate limits, robots restrictions, or a network outage can all produce incomplete or irrelevant text. For production, fetch the page with a controlled HTTP client, check status and timeouts, extract the article body, and pass cleaned text to PlaintextParser.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Use Sumy from the command line

sumy lex-rank --length=10 
  --url=https://en.wikipedia.org/wiki/Automatic_summarization

sumy lex-rank --language=uk --length=30 
  --url=https://uk.wikipedia.org/wiki/Україна

sumy luhn --language=czech 
  --url=https://www.zdrojak.cz/clanky/automaticke-zabezpeceni/

sumy edmundson --language=czech --length=3% 
  --url=https://cs.wikipedia.org/wiki/Bitva_u_Lipan

--length accepts a sentence count or a percentage in the documented examples. Run sumy --help against the installed release because options and defaults can change.

How Sumy’s algorithms differ

LSA

Latent Semantic Analysis represents term relationships and favors sentences associated with important concepts. It is a useful first baseline for documents with several themes, but short inputs provide little statistical signal and sentence order may need restoration.

LexRank

LexRank builds a similarity graph in which sentences are nodes; graph centrality, inspired by PageRank, identifies sentences representative of the document. It is a strong general baseline for informational or news-like text, not a universally best method. The original method is described at arXiv.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

TextRank

TextRank also ranks a sentence-similarity graph. It belongs to the same broad family as LexRank, but the implementations and scoring details are not identical.

Luhn

This heuristic emphasizes clusters of significant terms. It can suit keyword-heavy technical writing, while overvaluing repeated terminology and underrepresenting context.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Edmundson

Edmundson can combine cue words, title relevance, and sentence position. It is most useful when your application can define domain-specific signals.

SumBasic

SumBasic favors frequent words and is a simple research baseline. Frequency can capture a topic, but repeated terms can make the result redundant.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

KL-Sum

KL-Sum greedily chooses sentences that make the summary’s word distribution resemble the source. It can improve vocabulary coverage, although greedy choices do not guarantee global coherence.

Reduction

Reduction scores sentences through their relationships with other sentences and is related to TextRank-style similarity methods. Test it empirically on your corpus rather than assuming a ranking advantage.

Choose an algorithm with a small evaluation matrix

Use case First algorithms to try Reason
General article LexRank, TextRank, LSA Useful classical baselines
Keyword-heavy technical material Luhn, LexRank Rewards salient terms and central sentences
Several themes LSA, LexRank Concept and centrality signals
Frequency baseline SumBasic Simple comparison point
Domain cue words Edmundson Explicit heuristic features
Vocabulary coverage KL-Sum Distribution-oriented selection
Research comparison Test several Results are corpus- and task-dependent

Hold the corpus, language, summary length, metrics, and post-processing constant. Compare at least three algorithms on representative documents before choosing one.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Language, tokenization, and ordering

LANGUAGE = "english"
parser = PlaintextParser.from_string(text, Tokenizer(LANGUAGE))

Use the exact language identifier accepted by the installed release. Declared language metadata does not guarantee equal segmentation or stemming quality for every script. Test a short sample first, preserve Unicode punctuation and accents, and avoid silently stripping non-Latin characters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Importance ranking is not narrative ordering. If the output feels disjointed, retain each selected sentence’s original index and sort by source position, unless your application specifically needs rank order.

Evaluate summary quality

With a reference summary, run the documented evaluator:

sumy_eval lex-rank reference_summary.txt 
  --url=https://en.wikipedia.org/wiki/Automatic_summarization

sumy_eval lsa reference_summary.txt 
  --language=czech 
  --url=https://www.zdrojak.cz/clanky/automaticke-zabezpeceni/

Lexical-overlap metrics can help detect regressions, but they are not a verdict. Review coverage of essential points, redundancy, factual consistency with the source, sentence order, readability, and usefulness for the actual task. A summary can overlap strongly with a reference yet omit a crucial qualification.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

Import or command errors

  • Install into the interpreter you run: python -m pip install --upgrade sumy.
  • Check the environment with python -c "import sumy; print(sumy)".
  • Activate the correct virtual environment.
  • Rename local sumy.py files or sumy directories.

Tokenizer or language errors

Verify the language name supported by your installed version and test tokenization on a short string before processing a large document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Empty or poor summaries

  1. Print the parsed document to confirm that useful sentences were extracted.
  2. Remove HTML boilerplate and repeated headings.
  3. Lower the requested sentence count when the source is short.
  4. Try LexRank, LSA, and TextRank.
  5. Deduplicate or reorder selected sentences in application code.

Network and encoding problems

Handle HTTP status codes, timeouts, and inaccessible pages outside Sumy. Normalize input to UTF-8 and preserve Unicode characters.

Short or sensitive documents

A two-sentence input cannot yield a meaningful five-sentence summary. Local execution reduces transmission to a hosted service, but privacy compliance still requires appropriate access controls, logging, retention, and storage practices.

Sumy compared with modern summarization options

Option Advantages Trade-offs
Sumy Local, lightweight, extractive, source-traceable Limited fluency, no rewriting or deep synthesis
Custom NLTK, spaCy, or Gensim pipeline Custom linguistic features and scoring More engineering; not a drop-in Sumy CLI replacement
Transformer or local LLM Abstractive wording and broader synthesis Model size, hardware, latency, validation, and licensing
Cloud model API Managed scale, long context, instructions, multimodal workflows Usage cost, vendor dependence, data governance, changing behavior

For hosted choices, compare current terms rather than treating prices as permanent: Hugging Face Inference Providers, its pricing, Gemini API pricing, Amazon Bedrock, and Claude pricing. A focused alternative implementation is lexrank; it is not automatically more accurate.

When Sumy is the right choice

  • Local or privacy-sensitive processing where extractive traceability is valuable.
  • Lightweight scripts, teaching, prototypes, and reproducible baselines.
  • Applications that can validate input extraction and review sentence coherence.

Choose a transformer or hosted model when you need fluent paraphrasing, style instructions, synthesis across many documents, or managed scaling. Sumy is useful because it is simple and transparent—not because it offers the capabilities of a modern generative model.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.