{"library":"spacy-pkuseg","title":"spaCy Chinese Word Segmentation (pkuseg)","type":"library","description":"spacy-pkuseg is a Chinese word segmentation toolkit for spaCy, forked from pkuseg-python. It provides a `PkusegSegmenter` component to integrate robust Chinese segmentation directly into spaCy's NLP pipeline. The current stable version is 1.0.1, with releases primarily focused on Python and core dependency (like NumPy) compatibility updates.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install spacy-pkuseg"],"cli":null},"imports":["from spacy_pkuseg import PkusegSegmenter"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/explosion/spacy-pkuseg","docs":null,"changelog":null,"pypi":"https://pypi.org/project/spacy-pkuseg/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import spacy\n\n# Make sure to install a spaCy model, e.g., python -m spacy download en_core_web_sm\nnlp = spacy.load(\"en_core_web_sm\")\n\n# Add the pkuseg component to the pipeline\n# The default model is 'spacy_ontonotes'\nnlp.add_pipe(\"spacy_pkuseg\", last=True)\n\n# To specify a different model or user dictionary:\n# nlp.add_pipe(\"spacy_pkuseg\", config={\n#     \"model\": \"web\", \n#     \"user_dict\": \"path/to/your_dict.txt\"\n# }, last=True)\n\ntext = \"北京大学地球与空间科学学院\"\ndoc = nlp(text)\n\nprint(f\"Original text: {text}\")\nprint(f\"Tokens: {[token.text for token in doc]}\")","lang":"python","description":"This quickstart demonstrates how to load a spaCy model, add the `spacy_pkuseg` component to the pipeline, and process Chinese text to get word-segmented tokens. Ensure a spaCy model is installed first.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.0.1","pypi_latest":"1.0.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.1,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"111.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.1,"import_time_s":null,"mem_mb":null,"disk_size":"106M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"119.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4,"import_time_s":null,"mem_mb":null,"disk_size":"114M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"107.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.8,"import_time_s":null,"mem_mb":null,"disk_size":"102M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"107.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.9,"import_time_s":null,"mem_mb":null,"disk_size":"101M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"118.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"spacy-pkuseg","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.7,"import_time_s":null,"mem_mb":null,"disk_size":"116M"}]}}