2017 © Pedro PelĂĄez
 

library text-rank

Extract relevant keywords from a given text

image

crodas/text-rank

Extract relevant keywords from a given text

  • Tuesday, January 31, 2017
  • by crodas
  • Repository
  • 4 Watchers
  • 81 Stars
  • 13,685 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 16 Forks
  • 4 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

TextRank Build Status Flattr this

extract relevant keywords from a given text, (*1)

How to use it

In order to use the class, you must instance a Config object., (*2)

<?php

require __DIR__ . "/vendor/autoload.php";

use \crodas\TextRank\Config;
use \crodas\TextRank\TextRank;

$config   = new Config;
$textrank = new TextRank($config);

$keywords = $textrank->getKeywords($some_long_text);

var_dump($keywords);

It is possible to get better results by adding few information about the language (stopword list, stemmer with pecl install stem)., (*3)

<?php

require __DIR__ . "/vendor/autoload.php";

use \crodas\TextRank\Config;
use \crodas\TextRank\TextRank;
use \crodas\TextRank\Stopword;

$config = new Config;
$config->addListener(new Stopword);

$textrank = new TextRank($config);
$keywords = $textrank->getKeywords($some_long_text);

var_dump($keywords);

By doing this it will detect the language of the text and will remove common words (from the stopword list). If ext-stem is available the results will be even better., (*4)

Summarize large texts

This class is also capable of summarizing long texts, (*5)

$config = new \crodas\TextRank\Config;
$config->addListener(new \crodas\TextRank\Stopword);
$analizer = new \crodas\TextRank\Summary($config);
$summary = $analizer->getSummary($text);         

$summary is at most 5% of the sentences of the text., (*6)

The Versions

31/01 2017

dev-develop

dev-develop

Extract relevant keywords from a given text

  Sources   Download

The Requires

 

by CĂ©sar D. Rodas

08/12 2013

dev-master

9999999-dev

Extract relevant keywords from a given text

  Sources   Download

The Requires

 

by CĂ©sar D. Rodas

08/12 2013

dev-english-pos-tagger

dev-english-pos-tagger

Extract relevant keywords from a given text

  Sources   Download

The Requires

 

by CĂ©sar D. Rodas