{"id":24441,"library":"pytextrank","title":"PyTextRank","description":"Python implementation of TextRank as a spaCy pipeline extension for graph-based natural language work including phrase extraction, keyword extraction, and knowledge graph extraction. Current version 3.3.0, requires Python >=3.7, follows spaCy's extension pattern. Development is active but releases are infrequent.","status":"active","version":"3.3.0","language":"python","source_language":"en","source_url":"https://github.com/DerwenAI/pytextrank","tags":["nlp","textrank","keyword extraction","phrase extraction","knowledge graph","spacy"],"install":[{"cmd":"pip install pytextrank","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core dependency as a pipeline component; must match spaCy version compatibility","package":"spacy","optional":false},{"reason":"Used for graph algorithms; may be optional in future","package":"networkx","optional":true}],"imports":[{"wrong":"from pytextrank import PyTextRank","symbol":"PyTextRank","correct":"import pytextrank"}],"quickstart":{"code":"import spacy\nimport pytextrank\n\nnlp = spacy.load('en_core_web_sm')\nnlp.add_pipe('pytextrank')\n\ntext = \"Natural language processing enables computers to understand human language. It is used in chatbots and translation.\"\ndoc = nlp(text)\n\nfor phrase in doc._.phrases:\n    print(phrase.text, phrase.rank, phrase.count)","lang":"python","description":"Loads spaCy model, adds PyTextRank pipeline, processes text, and prints extracted keyphrases with rank and count."},"warnings":[{"fix":"Upgrade spaCy: pip install -U spacy","message":"PyTextRank 3.x requires spaCy 3.x. It will not work with spaCy 2.x. If you have spaCy 2.x, install an older PyTextRank version (<=2.x) or upgrade spaCy.","severity":"breaking","affected_versions":"pytextrank>=3.0.0, <3.0.0 with spacy<3.0.0"},{"fix":"Use doc._.phrases instead of doc._.textrank.","message":"Accessing keyphrases via doc._.phrases has replaced the older method doc._.textrank. The old method will be removed in a future version.","severity":"deprecated","affected_versions":"pytextrank>=3.2.0, <3.3.0"},{"fix":"Ensure nlp = spacy.load('en_core_web_sm') before nlp.add_pipe('pytextrank').","message":"The spaCy model must be loaded before adding PyTextRank pipeline. Adding the pipeline before loading the model will fail silently or raise an error.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'3.3.0':29 '3.7':32 'activ':40 'base':14 'current':27 'develop':38 'extens':10,36 'extract':20,22,26,48,50 'follow':33 'graph':13,25,52 'graph-bas':12 'implement':3 'includ':18 'infrequ':44 'keyword':21,47 'knowledg':24,51 'languag':16 'natur':15 'nlp':45 'pattern':37 'phrase':19,49 'pipelin':9 'pytextrank':1 'python':2,31 'releas':42 'requir':30 'spaci':8,34,53 'textrank':5,46 'version':28 'work':17","created_at":"2026-05-01T08:13:06.356005+00:00","updated_at":"2026-05-01T08:13:06.356005+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp1iqnkmlr/venv/lib/python3.12/site-packages/pytextrank/__init__.py\", line 12, in <module>\n    from spacy.language import Language  # type: ignore # pylint: disable=E0401\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n "},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.3.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://derwen.ai/docs/ptr/","github":"http://github.com/DerwenAI/pytextrank","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytextrank/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}