executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
native-workflowsGuides local HanLP native Python workflows with pretrained model loading, pipeline composition, task selection, cache/device controls, and no-download smoke checks.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when a task needs local Python HanLP rather than only a RESTful service: hanlp.load, hanlp.pretrained, hanlp.pipeline, MTL task selection, sentence splitting, device/cache controls, or a safe no-download smoke check.
references/native-api-reference.md for verified signatures, local inference patterns, pipeline composition, tasks, skip_tasks, and device arguments.references/pretrained-models.md for model-family routing, identifier names, language/task coverage, and download/cache caveats.references/troubleshooting.md for model download, cache, device, and local input-shape failures.scripts/pipeline_smoke.py to verify no-download hanlp.pipeline behavior.scripts/split_sentence_smoke.py for deterministic sentence splitting without loading a pretrained EOS model.python -c "import hanlp; print(hanlp.__version__, len(hanlp.pretrained.ALL))"
This confirms import and identifier registration. It does not prove that a pretrained model archive is downloaded or that GPU acceleration works.
| User need | Use |
|---|---|
| Load a pretrained MTL or single-task model by identifier or URL | hanlp.load(identifier, devices=..., verbose=...) in references/native-api-reference.md |
| Pick model families for tokenization, POS, NER, dependency/constituency parsing, SRL, SDP, AMR, classification, STS, or language ID | references/pretrained-models.md |
| Run fewer tasks or use pre-tokenized input with an MTL model | tasks= and skip_tasks= notes in references/native-api-reference.md |
| Split a document before local sentence-level models | scripts/split_sentence_smoke.py and sentence-splitting notes |
| Compose several single-task components | hanlp.pipeline().append(..., input_key=..., output_key=...) |
devices=-1 for CPU-oriented checks when the component supports it. Use GPU devices only after verifying a compatible GPU-enabled backend.tasks to limit output work and skip_tasks='tok*' when passing pre-tokenized sentences to compatible MTL models.