sumy: Automatic Text Summarization for Documents and HTML Pages

This repository profile is provided by osrepos.com, an open source repository discovery platform.

sumy: Automatic Text Summarization for Documents and HTML Pages

Summary

sumy is a robust Python module designed for automatic summarization of text documents and HTML pages. It provides various summarization methods, supports multiple natural languages, and offers both a command-line utility and a flexible Python API. This versatile tool enables users to efficiently extract concise summaries from lengthy content.

Repository Information

Analyzed by OSRepos on December 14, 2025

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

sumy is a powerful and easy-to-use Python library for automatic text summarization. It allows you to extract concise summaries from various sources, including plain text documents and HTML pages. Built with flexibility in mind, sumy supports several popular summarization algorithms, such as LexRank, LSA, Luhn, and Edmundson, making it adaptable to different summarization needs. Furthermore, it boasts multi-language support, with an extensible framework to add new languages easily.

Installation

Getting started with sumy is straightforward. Ensure you have Python 3.6+ and pip installed on your system.

To install the stable version:

$ pip install sumy

For the very latest version directly from the GitHub repository:

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

You can also run sumy as a Docker container, avoiding local installation complexities:

$ docker run --rm misobelica/sumy lex-rank --length=10 --url=https://en.wikipedia.org/wiki/Automatic_summarization

Examples

sumy provides both a command-line interface for quick summarization and a Python API for integration into your projects.

Command-Line Usage

Summarize content directly from a URL:

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

Get help and explore more options:

$ sumy --help

sumy also includes a utility for evaluating summarization methods:

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

Python API

Integrate sumy into your Python applications as a library. Here's a basic example to summarize an HTML page:

# -*- coding: utf-8 -*-

from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals

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


LANGUAGE = "english"
SENTENCES_COUNT = 10


if __name__ == "__main__":
    url = "https://en.wikipedia.org/wiki/Automatic_summarization"
    parser = HtmlParser.from_url(url, Tokenizer(LANGUAGE))
    # or for plain text files
    # parser = PlaintextParser.from_file("document.txt", Tokenizer(LANGUAGE))
    # parser = PlaintextParser.from_string("Check this out.", Tokenizer(LANGUAGE))
    stemmer = Stemmer(LANGUAGE)

    summarizer = Summarizer(stemmer)
    summarizer.stop_words = get_stop_words(LANGUAGE)

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

Why Use sumy?

sumy stands out as an excellent choice for text summarization due to several key features:

  • Versatile Input: It can process both plain text and HTML content, making it suitable for a wide range of applications, from local documents to web scraping.
  • Multiple Algorithms: With implementations of various summarization techniques like LSA, LexRank, Luhn, and Edmundson, you can choose the method best suited for your specific summarization task.
  • Multi-language Support: sumy is designed to support multiple natural languages, and its architecture makes it easy to extend support for new languages.
  • Ease of Use: Whether you prefer a quick command-line summary or deep integration into a Python project, sumy offers intuitive interfaces for both.
  • Active Development: The project is actively maintained and has a strong community, as evidenced by its significant number of stars and forks on GitHub.
  • Evaluation Framework: It includes tools for evaluating the quality of generated summaries, which is crucial for research and fine-tuning.

Links

Related repositories

Similar repositories that may be relevant next.

awesome-cli-coding-agents: A Curated Directory of Terminal-Native AI Tools

awesome-cli-coding-agents: A Curated Directory of Terminal-Native AI Tools

August 9, 2026

The `awesome-cli-coding-agents` repository offers a comprehensive, curated directory of over 100 terminal-native AI coding agents. These powerful tools operate directly within your command line, enabling autonomous code reading, editing, and execution. The list also covers various harnesses and orchestration solutions for managing these agents.

AICLICoding Agents
QwenPaw: Your Personal AI Assistant for Local and Cloud Deployment

QwenPaw: Your Personal AI Assistant for Local and Cloud Deployment

August 7, 2026

QwenPaw is a powerful personal AI assistant designed for easy installation and deployment, either on your local machine or in the cloud. It supports multiple chat applications and offers highly extensible capabilities, making it a versatile tool for various AI-driven tasks. With its robust memory system and security features, QwenPaw aims to be an intuitive and private partner in your digital life.

agentai-agentchatbot
DeepTutor: Lifelong Personalized Tutoring with AI Agents

DeepTutor: Lifelong Personalized Tutoring with AI Agents

August 7, 2026

DeepTutor is an advanced AI-powered platform designed for lifelong personalized tutoring, integrating various learning modes into a single, extensible system. It leverages large language models and multi-agent systems to offer features like interactive chat, quiz generation, and skill development. This project provides a comprehensive environment for learners and educators seeking intelligent, adaptive educational tools.

AITutoringLLM
Memori: Agent-Native Memory Infrastructure for LLM Production Systems

Memori: Agent-Native Memory Infrastructure for LLM Production Systems

August 6, 2026

Memori provides agent-native memory infrastructure, offering an LLM-agnostic layer that transforms agent execution and conversations into structured, persistent state. Designed for enterprise use, it seamlessly integrates with existing data infrastructure and supports various deployment environments, ensuring robust memory management for AI agents.

agent-memoryLLMAI

Source repository

Open the original repository on GitHub.

16 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️