Sumy is a Python 3.8+ library and command-line utility for automatic summarization of text documents and HTML pages, providing extractive summaries through algorithms such as LexRank, Luhn, Edmundson, and LSA.
What is Sumy?
Sumy is an open-source Python library and CLI that extracts the most important sentences from a document, producing a summary at a length you specify. It accepts input from HTML pages via URL or plain text via file or string, and returns a list of sentences ranked by the selected summarization algorithm. The project is maintained by Miso Belica on GitHub and has 3,699 stars on the repository as of the README metadata.
Key Features
- Multiple summarization algorithms — LexRank, Luhn, Edmundson, and LSA are available through both the command line and Python API, giving you different approaches to sentence scoring.
- Multilingual tokenization — Sumy's tokenizer covers multiple natural languages with stop-word lists; the README demonstrates summaries in English, Ukrainian, and Czech, and adding a new language is described in the docs.
- HTML and plain text input — The
HtmlParserfetches and parses a page from a URL, whilePlaintextParserreads from a file or a string, so the same summary pipeline works across sources. - Python API and CLI — Run
sumywith arguments like--length,--language, and--urlin the terminal, or import parser, tokenizer, stemmer, and summarizer classes in a Python script. - Evaluation framework — The
sumy_evalcommand compares a generated summary to a reference summary, enabling you to measure algorithm quality. - Containerized usage — A Docker image
misobelica/sumyruns summaries without requiring local Python setup. - Browser-based demo — A live web interface is hosted on Hugging Face Spaces at
huggingface.co/spaces/issam9/sumy_space.
Who is it for?
- Python developers building document-processing pipelines can embed Sumy to automatically shorten news articles or reports before further analysis.
- NLP researchers can use the evaluation framework to benchmark LexRank, Luhn, Edmundson, and LSA against reference summaries.
- Content curators can condense long web pages into a few key sentences for digests, newsletters, or internal briefs.
- Community bot maintainers can integrate Sumy into automation, such as the AutoTL;DR bot for Lemmy that summarizes discussions.
What can you do with Sumy?
- Summarize web pages: Run
sumy lex-rank --length=10 --url=https://en.wikipedia.org/wiki/Automatic_summarizationto get a 10-sentence summary of any Wikipedia article. - Build question-generation systems: The "Learning to generate questions from text" project uses Sumy to identify key sentences before generating questions.
- Summarize videos: Projects like VideoMash use Sumy to condense video transcripts into summaries of any target duration.
- Summarize discussions: The wikum tool collectively summarizes large discussion threads using Sumy's sentence extraction.
How does Sumy work?
Sumy reads a document from a URL, file, or string, then tokenizes the text into sentences using a language-specific tokenizer. The chosen summarization algorithm scores each sentence using features such as word frequency, position, or latent semantic analysis, and returns the top-sentence subset at the length you request — either a number of sentences or a percentage of the original text.
FAQ
What Python versions does Sumy support?
Sumy requires Python 3.8 or newer. You can install it with pip install sumy or uv pip install sumy, and the repository also supports development setups with uv sync.
Can Sumy summarize text in languages other than English?
Yes. Sumy's tokenizer supports many languages and lets you pass a --language argument. The README demonstrates summaries in Ukrainian and Czech, and custom languages can be added by following the included documentation.
Can I use Sumy as a Python library?
Yes. The README shows an example using HtmlParser.from_url, PlaintextParser, a Stemmer, and a summarizer object to extract sentences from a document within a Python script.
Does Sumy generate original text or extract existing sentences?
Sumy uses extractive summarization, so the summary is a selection of the most important sentences from the source document, not newly generated prose. This distinguishes it from abstractive summarizers.







