Best free PHP keyword extraction libraries on GitHub?

Daemon

Regular Member
Joined
Dec 31, 2009
Messages
209
Reaction score
79
I was wondering if people could suggest any free PHP libraries for keyword extraction from text. And any advice on what one should look for in such a library.

I searched for “keyword extraction”, though I don’t know how to pick between these, or if any good libraries aren’t being shown in this list.

https://github.com/search?l=PHP&o=desc&q=keyword+extraction&s=stars&type=Repositories
This library, RAKE PHP Plus, seems to be the PHP library with the most stars:
https://github.com/Donatello-za/rake-php-plus
Right now that's probably the one I will go with, unless somebody can suggest something better.
 
what do you mean by keyword extractor?
I mean a library that can give you the keywords from a piece of text, and maybe some sort of relevancy score information. For instance here is an example from the RAKE PHP Plus page I linked to:
use DonatelloZa\RakePlus\RakePlus;

$text = "Criteria of compatibility of a system of linear Diophantine equations, " .
"strict inequations, and nonstrict inequations are considered. Upper bounds " .
"for components of a minimal set of solutions and algorithms of construction " .
"of minimal generating sets of solutions for all types of systems are given.";

$phrases = RakePlus::create($text)->get();

print_r($phrases);

Array
(
[0] => criteria
[1] => compatibility
[2] => system
[3] => linear diophantine equations
[4] => strict inequations
[5] => nonstrict inequations
[6] => considered
[7] => upper bounds
[8] => components
[9] => minimal set
[10] => solutions
[11] => algorithms
[12] => construction
[13] => minimal generating sets
[14] => types
[15] => systems
)

$phrase_scores = $rake->sortByScore('desc')->scores();
print_r($phrase_scores);

Array
(
[linear diophantine equations] => 9
[minimal generating sets] => 8.5
[minimal set] => 4.5
[strict inequations] => 4
[nonstrict inequations] => 4
[upper bounds] => 4
[criteria] => 1
[compatibility] => 1
[system] => 1
[considered] => 1
[components] => 1
[solutions] => 1
[algorithms] => 1
[construction] => 1
[types] => 1
[systems] => 1
)
 
Back
Top