Skip to main content

image image Build Status Coverage Status Requirements Status

What is this?

Potara is a multi-document summarization system that relies on Integer Linear Programming (ILP) and sentence fusion.

Its goal is to summarize a set of related documents in a few sentences. It proceeds by fusing similar sentences in order to create sentences that are either shorter or more informative than those found in the documents. It then uses ILP in order to choose the best set of sentences, fused or not, that will compose the resulting summary.

It relies on state-of-the-art (as of 2014) approaches introduced by Gillick and Favre for the ILP strategy, and Filippova for the sentence fusion.

It is compatible and tested with Python 3.5 and 3.6.

Install

The easy way

You should be able to install potara and its dependencies with pip

pip install potara

You can also clone this repo and use the requirements.txt file to install dependencies

further requirements

You will also need GLPK, which is used to obtain an optimal summary (example for Debian-based distro)

$ sudo apt-get install glpk

For Ubuntu-based distros you can use:

$ sudo apt-get install libglpk40

You can check that the install run successfully by cloning the repo and running

$ python setup.py test

If you have issues with install, you can check the .travis.yml file of the repo, which corresponds to a working build.

How To

Basically, you can use the following

from potara.summarizer import Summarizer
from potara.document import Document

s = Summarizer()

# Adding docs, preprocessing them and computing some infos for the summarizer
s.setDocuments([Document('data/' + str(i) + '.txt')
                for i in range(1,10)])

# Summarizing, where the actual work is done
s.summarize()

# You can then print the summary
print(s.summary)

There's some preprocessing involved and a sentence fusion step, but I made it easily tunable. Preprocessing may take a while (a few minutes) since there is a lot going on under the hood. Default parameters are currently set for summarizing ~10 documents. You can summarize a smaller amount of documents by tweaking the "minbigramcount" parameter of the summarizer :

s = Summarizer(minbigramcount=2)

Summarizing less than 4 documents would probably yield a bad summary.

Similarity models

Potara relies on similarity scores between sentences. These scores can be shallow using a cosine similarity, or "deep" using gensim Word2Vec semantic representation of words. For the second use case, you'll want to train your own model or use pretrained models. You may contact me if you want to use potara that way, and I may create a tutorial on the matter for the occasion.

Metadata

Release files for potara 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for potara 1.0.2
File Size Uploaded
potara-1.0.2.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for potara 1.0.2
File Interpreter ABI Platform
potara-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 49.0 kB

Release files / potara-1.0.2.tar.gz

Download URL potara-1.0.2.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6112d89172521b4703373a585a245fccd13d66cf1624aeb9ae1e576905d35799
BLAKE2b-256 checksum
How to use checksums
88b5d7facf0c6be83793eb34534d9f73fbf6427a468dc97aa89d8c568d0cff15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.2

Release files / potara-1.0.2-py3-none-any.whl

Download URL potara-1.0.2-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92b3f89833cffbc3ca84028660468b48e50bbb78f7bd62d8811729df8bb25ce2
BLAKE2b-256 checksum
How to use checksums
75edf1817ad122139fbafd1c938cad742ffe5c0ffa2a7992d3be1d705ac36851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.2

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page