This tool will give a summary for the given text by ranking each sentence by its relevance.
Features
Here is how to create the summary of a given text.
From local file:
require_once(dirname(__FILE__) . '/Summarizer.php');
$text = file_get_contents(dirname(__FILE__) . '/test_files/cap1.txt');
$summarizer = new Summarizer();
$summarizer->loadText($text);
$summary = $summarizer->run();
print_r($summary);
From remote url:
require_once(dirname(__FILE__) . '/Summarizer.php');
$url = 'http://edition.cnn.com/2011/LIVING/02/07/russell.simmons.super.rich/index.html?hpt=C2';
$summarizer = new Summarizer();
$summarizer->loadUrl($url);
$summary = $summarizer->run();
print_r($summary);
To view all of the available class methods take a look at the API reference.
If you are looking for a demo of the Summarizer script you can find here a fully working summarizer.
Questions & Comments