All Projects → miso-belica → Sumy

miso-belica / Sumy

Licence: apache-2.0
Module for automatic summarization of text documents and HTML pages.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sumy

Scripts-for-extractive-summarization
Scripts for an upcoming blog "Extractive vs. Abstractive Summarization" for RaRe Technologies.
Stars: ✭ 12 (-99.56%)
Mutual labels:  lsa, sumy
FYP-AutoTextSum
Automatic Text Summarization with Machine Learning
Stars: ✭ 16 (-99.41%)
Mutual labels:  summarization, summarizer
Lexrank
LexRank algorithm for text summarization
Stars: ✭ 108 (-96.01%)
Mutual labels:  summary, summarization
Androiddevelopmentsummary
安卓开发总结——附带VPN翻墙
Stars: ✭ 144 (-94.68%)
Mutual labels:  summary
Article Summarizer
Uses frequency analysis to summarize text.
Stars: ✭ 147 (-94.57%)
Mutual labels:  summary
Arxivnotes
IssuesにNLP(自然言語処理)に関連するの論文を読んだまとめを書いています.雑です.🚧 マークは編集中の論文です(事実上放置のものも多いです).🍡 マークは概要のみ書いてます(早く見れる的な意味で団子).
Stars: ✭ 190 (-92.98%)
Mutual labels:  summary
Summarunner
The PyTorch Implementation of SummaRuNNer
Stars: ✭ 214 (-92.09%)
Mutual labels:  summary
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (-94.71%)
Mutual labels:  summarization
Papers
Summaries of machine learning papers
Stars: ✭ 2,362 (-12.68%)
Mutual labels:  summary
Adversarial video summary
Unofficial PyTorch Implementation of SUM-GAN from "Unsupervised Video Summarization with Adversarial LSTM Networks" (CVPR 2017)
Stars: ✭ 187 (-93.09%)
Mutual labels:  summarization
Breadability
Reworked https://www.readability.com/ parsing library (now https://mercury.postlight.com/ is living alternative)
Stars: ✭ 186 (-93.12%)
Mutual labels:  text-extraction
Pythonrouge
Python wrapper for evaluating summarization quality by ROUGE package
Stars: ✭ 155 (-94.27%)
Mutual labels:  summarization
Textrank
🌀 ⚡️ 🌍 TextRank (automatic text summarization) for PHP8
Stars: ✭ 193 (-92.87%)
Mutual labels:  summarization
Gitbook Summary
A command line tool to generate a summary.md for Gitbook
Stars: ✭ 145 (-94.64%)
Mutual labels:  summary
Azure In Bullet Points
☁️ Azure summary in bullet points
Stars: ✭ 205 (-92.42%)
Mutual labels:  summary
Neusum
Code for the ACL 2018 paper "Neural Document Summarization by Jointly Learning to Score and Select Sentences"
Stars: ✭ 143 (-94.71%)
Mutual labels:  summarization
Aws In Bullet Points
☁️ AWS summary in bullet points
Stars: ✭ 197 (-92.72%)
Mutual labels:  summary
Cx db8
a contextual, biasable, word-or-sentence-or-paragraph extractive summarizer powered by the latest in text embeddings (Bert, Universal Sentence Encoder, Flair)
Stars: ✭ 164 (-93.94%)
Mutual labels:  summarization
Lambda Text Extractor
AWS Lambda functions to extract text from various binary formats.
Stars: ✭ 159 (-94.12%)
Mutual labels:  text-extraction
Acl Papers
paper summary of Association for Computational Linguistics
Stars: ✭ 189 (-93.01%)
Mutual labels:  summary

Automatic text summarizer

image Gitpod Ready-to-Code

Simple library and command line utility for extracting summary from HTML pages or plain texts. The package also contains simple evaluation framework for text summaries. Implemented summarization methods are described in the documentation. I also maintain a list of alternative implementations of the summarizers in various programming languages.

Is my natural language supported?

There is a good chance it is. But if not it is not too hard to add it.

Installation

Make sure you have Python 3.5+ and pip (Windows, Linux) installed. Run simply (preferred way):

$ [sudo] pip install sumy
$ [sudo] pip install git+git://github.com/miso-belica/sumy.git  # for the fresh version

Usage

Sumy contains command line utility for quick summarization of documents.

$ sumy lex-rank --length=10 --url=http://en.wikipedia.org/wiki/Automatic_summarization # what's summarization?
$ sumy luhn --language=czech --url=http://www.zdrojak.cz/clanky/automaticke-zabezpeceni/
$ sumy edmundson --language=czech --length=3% --url=http://cs.wikipedia.org/wiki/Bitva_u_Lipan
$ sumy --help # for more info

Various evaluation methods for some summarization method can be executed by commands below:

$ sumy_eval lex-rank reference_summary.txt --url=http://en.wikipedia.org/wiki/Automatic_summarization
$ sumy_eval lsa reference_summary.txt --language=czech --url=http://www.zdrojak.cz/clanky/automaticke-zabezpeceni/
$ sumy_eval edmundson reference_summary.txt --language=czech --url=http://cs.wikipedia.org/wiki/Bitva_u_Lipan
$ sumy_eval --help # for more info

If you don't want to bother by the installation, you can try it as a container.

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

Python API

Or you can use sumy like a library in your project. Create file sumy_example.py (don't name it sumy.py) with the code below to test it.

# -*- 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)

Interesting projects using sumy

I found some interesting projects while browsing the interner or sometimes people wrote me an e-mail with questions and I was curious how they use the sumy :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].