2017 © Pedro PelĂĄez
 

library textrank

TextRank (automatic text summarization) for PHP7 and HHVM.

image

php-science/textrank

TextRank (automatic text summarization) for PHP7 and HHVM.

  • Wednesday, April 18, 2018
  • by DoveID
  • Repository
  • 3 Watchers
  • 25 Stars
  • 11,243 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 6 Versions
  • 115 % Grown

The README.md

TextRank

, (*1)

This source code is an implementation of TextRank algorithm in PHP programming language, under MIT licence.

, (*2)

TextRank vs. ChatGPT

GPTs like ChatGPT are supervised language models that understand the context and generate new content from the given input using vast resources while TextRank is a cost-efficient/low-cost text extraction algorithm. TextRank algorithm also can be used as a pre-processor to a GPT model to reduce the text size to save on resource consumption., (*3)

TextRank or Automatic summarization

Automatic summarization is the process of reducing a text document with a computer program in order to create a summary that retains the most important points of the original document. Technologies that can make a coherent summary take into account variables such as length, writing style and syntax. Automatic data summarization is part of machine learning and data mining. The main idea of summarization is to find a representative subset of the data, which contains the information of the entire set. Summarization technologies are used in a large number of sectors in industry today. - Wikipedia, (*4)

The algorithm of this implementation is: * Extracts sentences, * Removes stopwords, * Adds integer values to words by finding and counting the matching words, * Weights the values of the words, * Normalizes values to get the scores, * Sorts by scores, (*5)

Install to use it in your project

cd your-project-folder
composer require php-science/textrank

Install for contributing

cd git-project-folder
docker-compose build
docker-compose up -d
composer install
composer test

Examples


use PhpScience\TextRank\Tool\StopWords\English; // String contains a long text, see the /res/sample1.txt file. $text = "Lorem ipsum..."; $api = new TextRankFacade(); // English implementation for stopwords/junk words: $stopWords = new English(); $api->setStopWords($stopWords); // Array of the most important keywords: $result = $api->getOnlyKeyWords($text); // Array of the sentences from the most important part of the text: $result = $api->getHighlights($text); // Array of the most important sentences from the text: $result = $api->summarizeTextBasic($text);

More examples: * tests/TextRankFacadeTest.php * https://php.science, (*6)

Authors, Contributors

Name GitHub user
David Belicza @DavidBelicza
Riccardo Marton @riccardomarton
Syndesi @Syndesi
vincentsch @vincentsch
Andrew Welch @khalwat
Andrey Astashov @mvcaaa
Leo Toneff @bragle
Willy Arisky @willyarisky
Robert-Jan Keizer @KeizerDev
Morty @evil1morty
Sezer Fidancı @SezerFidanci

The Versions

18/04 2018

dev-master

9999999-dev

TextRank (automatic text summarization) for PHP7 and HHVM.

  Sources   Download

MIT

The Requires

  • php 7.*

 

The Development Requires

by David Belicza

hhvm php7 summarization automatic science strict textrank

18/04 2018

1.0.4

1.0.4.0

TextRank (automatic text summarization) for PHP7 and HHVM.

  Sources   Download

MIT

The Requires

  • php 7.*

 

The Development Requires

by David Belicza

hhvm php7 summarization automatic science strict textrank

18/12 2017

1.0.3

1.0.3.0

TextRank (automatic text summarization) for PHP7 and HHVM.

  Sources   Download

MIT

The Requires

  • php 7.*

 

The Development Requires

by David Belicza

hhvm php7 summarization automatic science strict textrank

21/11 2017

1.0.2

1.0.2.0

TextRank (automatic text summarization) for PHP7 and HHVM.

  Sources   Download

MIT

The Requires

  • php 7.*

 

The Development Requires

by David Belicza

hhvm php7 summarization automatic science strict textrank

06/08 2016

1.0.1

1.0.1.0

TextRank (automatic text summarization) for PHP7 and HHVM.

  Sources   Download

MIT

The Requires

  • php 7.*

 

The Development Requires

by David Belicza

hhvm php7 summarization automatic science strict textrank

06/08 2016

1.0.0

1.0.0.0

TextRank (automatic text summarization) for PHP7 and HHVM.

  Sources   Download

MIT

The Requires

  • php 7.*
  • hhvm 3.*

 

The Development Requires

by David Belicza

hhvm php7 summarization automatic science strict textrank