jord-jd/php-summary

PHP Summarization Library

Maintainers

Package info

github.com/Jord-JD/php-summary

pkg:composer/jord-jd/php-summary

Transparency log

Fund package maintenance!

DivineOmega

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 34

Open Issues: 0

v5.0.1 2026-07-18 02:59 UTC

README

Tests Packagist

A PHP library to automatically summarise text using a naive summarisation algorithm.

This summarisation algorithm takes the key sentence from each paragraph. It then strings these resulting sentences together to form the summary. Single-sentence paragraphs and final sentences without punctuation are supported.

For more details on this algorithm, see this blog post by Shlomi Babluki.

Installation

Require this package, with Composer, in the root directory of your project.

composer require jord-jd/php-summary

Usage

To use PHP Summary, you should create a new SummaryTool object, passing it the text content of your article. You can then call its getSummary method to retrieve the shortened summary of the article.

Paragraphs may be separated by blank Unix, Windows, or classic Mac lines.

use JordJD\PHPSummary\SummaryTool;

$summary = (new SummaryTool($content))->getSummary();