计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
legacy-extension【效率与协作】Guides LTP legacy perceptron and ltp_extension workflows for fast CWS/POS/NER, custom segmentation rules, and trainer APIs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill for the Rust-backed Python extension surface: fast legacy CWS/POS/NER, sentence splitting utilities, custom word hooks, CWS character-type rules, direct model files, and perceptron trainer APIs.
LTP("LTP/legacy"), ltp_extension, CWSModel, POSModel, NERModel, CharacterType, Algorithm, Trainer, CWSTrainer, POSTrainer, or NERTrainer.For neural SRL/DEP/SDP/SDPG, use ../python-pipeline/SKILL.md. For Rust-native crate use, use ../rust-bindings/SKILL.md.
Verify imports without model downloads:
python ../../scripts/check_ltp_install.py --json
python scripts/legacy_rules_smoke.py --no-model
For high-level legacy inference, use the factory when a complete legacy model directory or cache is available:
from ltp import LTP
ltp = LTP("LTP/legacy")
output = ltp.pipeline(["他叫汤姆去拿外衣。"], tasks=["cws", "pos", "ner"])
For direct model files, use specialized extension classes:
from ltp_extension.perceptron import CWSModel, POSModel, NERModel
cws = CWSModel.load("cws_model.bin")
pos = POSModel.load("pos_model.bin")
ner = NERModel.load("ner_model.bin")
words = cws.predict("他叫汤姆去拿外衣。")
tags = pos.predict(words)
entities = ner.predict(words, tags)
Validate trainer inputs before training:
python scripts/legacy_trainer_config_check.py --task cws --train-file train.txt --eval-file dev.txt --algorithm AP
CharacterType, and optional local CWS model rule setup without downloads.