Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Module for automatic summarization of text documents and HTML pages.
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.
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.
HtmlParser fetches and parses a page from a URL, while PlaintextParser reads from a file or a string, so the same summary pipeline works across sources.sumy with arguments like --length, --language, and --url in the terminal, or import parser, tokenizer, stemmer, and summarizer classes in a Python script.sumy_eval command compares a generated summary to a reference summary, enabling you to measure algorithm quality.misobelica/sumy runs summaries without requiring local Python setup.huggingface.co/spaces/issam9/sumy_space.sumy lex-rank --length=10 --url=https://en.wikipedia.org/wiki/Automatic_summarization to get a 10-sentence summary of any Wikipedia article.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.
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.
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.
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.
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.
