{"id":26848988,"url":"https://github.com/crodas/textrank","last_synced_at":"2025-04-08T04:16:21.285Z","repository":{"id":56959423,"uuid":"14135944","full_name":"crodas/TextRank","owner":"crodas","description":"extract relevant keywords from a given text","archived":false,"fork":false,"pushed_at":"2017-01-31T00:59:56.000Z","size":936,"stargazers_count":104,"open_issues_count":5,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T21:27:26.537Z","etag":null,"topics":["extract-relevant-keywords","php","textrank"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crodas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-05T08:27:52.000Z","updated_at":"2023-09-07T04:37:55.000Z","dependencies_parsed_at":"2022-08-21T09:50:43.963Z","dependency_job_id":null,"html_url":"https://github.com/crodas/TextRank","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crodas%2FTextRank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crodas%2FTextRank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crodas%2FTextRank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crodas%2FTextRank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crodas","download_url":"https://codeload.github.com/crodas/TextRank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773720,"owners_count":20993639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extract-relevant-keywords","php","textrank"],"created_at":"2025-03-30T21:24:01.280Z","updated_at":"2025-04-08T04:16:21.245Z","avatar_url":"https://github.com/crodas.png","language":"PHP","readme":"TextRank [![Build Status](https://travis-ci.org/crodas/TextRank.png?branch=master)](https://travis-ci.org/crodas/TextRank) \u003ca href=\"https://flattr.com/submit/auto?user_id=crodas\u0026url=https%3A%2F%2Fgithub.com%2Fcrodas%2Ftextrank\" target=\"_blank\"\u003e\u003cimg src=\"https://api.flattr.com/button/flattr-badge-large.png\" alt=\"Flattr this\" title=\"Flattr this\" border=\"0\"\u003e\u003c/a\u003e\n========\n\nextract relevant keywords from a given text\n\n\nHow to use it\n-------------\n\nIn order to use the class, you must instance a `Config` object.\n\n\n```php\n\u003c?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse \\crodas\\TextRank\\Config;\nuse \\crodas\\TextRank\\TextRank;\n\n$config   = new Config;\n$textrank = new TextRank($config);\n\n$keywords = $textrank-\u003egetKeywords($some_long_text);\n\nvar_dump($keywords);\n\n```\n\nIt is possible to get better results by adding few information about the language (`stopword` list, `stemmer` with `pecl install stem`).\n\n\n```php\n\u003c?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse \\crodas\\TextRank\\Config;\nuse \\crodas\\TextRank\\TextRank;\nuse \\crodas\\TextRank\\Stopword;\n\n$config = new Config;\n$config-\u003eaddListener(new Stopword);\n\n$textrank = new TextRank($config);\n$keywords = $textrank-\u003egetKeywords($some_long_text);\n\nvar_dump($keywords);\n\n```\nBy 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.\n\n\nSummarize large texts\n---------------------\n\nThis class is also capable of summarizing long texts\n\n```php\n$config = new \\crodas\\TextRank\\Config;\n$config-\u003eaddListener(new \\crodas\\TextRank\\Stopword);\n$analizer = new \\crodas\\TextRank\\Summary($config);\n$summary = $analizer-\u003egetSummary($text);         \n```\n\n`$summary` is at most 5% of the sentences of the text.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrodas%2Ftextrank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrodas%2Ftextrank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrodas%2Ftextrank/lists"}