triple-extraction
Guide DeepKE PRGC, PURE, ASP, MT5, and cnSchema triple extraction workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- triple-extraction
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guide DeepKE PRGC, PURE, ASP, MT5, and cnSchema triple extraction workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/data-and-config.md5.5 KB
- 参考文档references/troubleshooting.md5.0 KB
- 参考文档references/workflows.md8.1 KB
- 脚本scripts/check_triple_env.py11.2 KB
- 脚本scripts/convert_mt5_predictions.py7.1 KB
03 SKILL.md 正文
DeepKE triple extraction
Use this sub-skill when a task asks for relational triple extraction or joint entity-relation extraction with DeepKE's PRGC, PURE, ASP, MT5/CCKS, or cnSchema triple workflows. It is for planning, configuring, validating, troubleshooting, and safely post-processing these workflows without assuming the original DeepKE checkout is still available.
Route by intent
- Choose PRGC, PURE, ASP, MT5, or cnSchema: read references/workflows.md for the scenario decision table and end-to-end operating recipes.
- Inspect dataset files, generated prediction files, or Hydra/DeepSpeed options: read references/data-and-config.md before changing filenames, relation labels, or model paths.
- Post-process MT5/CCKS predictions into JSONL with
kgtriples: use scripts/convert_mt5_predictions.py. This is the safe bundled replacement for the source MT5 conversion helper. - Check local imports, CUDA visibility, and optional file paths without training: run scripts/check_triple_env.py before approving long native runs.
- Debug dependency, CUDA, Apex, DeepSpeed, checkpoint, or malformed-output failures: read references/troubleshooting.md.
What this sub-skill owns
- PRGC joint relational triple extraction using potential relations plus global correspondence, usually over CMeIE/NYT/WebNLG-style
*_triples.jsonfiles andrel2id.json. - PURE staged entity extraction plus relation extraction using JSON data and BERT-style encoders.
- ASP autoregressive structured prediction for entity-relation extraction, including its CUDA/Apex-heavy runtime expectations.
- MT5/CCKS generative triple extraction with DeepSpeed and prediction conversion from
outputstrings tokgtriples. - cnSchema triple workflows that combine DeepKE's Chinese schema-oriented NER/RE/triple examples and require preselected schema labels or checkpoints.
What this sub-skill does not own
- Standard sentence-level RE, document RE, NER, AE, or EE outside a triple-extraction workflow; route those to the sibling
supervised-extractionsub-skill. - Generic data annotation, weak NER labeling, or distant RE labeling; route those to
data-preparationunless the data is already in a triple-workflow-specific format. - DeepKE-LLM instruction KGC, OneKE, CodeKGC, GPT/API prompting, or large-model LoRA/P-tuning; route those to
llm-workflows. - MCP server/client exposure of extraction predictors; route that to
mcp-tools.
Quick operating pattern
- Identify whether the user has labeled triples, generated predictions, a pretrained checkpoint, or only a goal.
- Pick the smallest workflow that matches the data and runtime: PRGC for classic joint extraction, PURE for staged entity/relation modeling, ASP for autoregressive structured prediction, MT5 for generative CCKS-style extraction, or cnSchema for Chinese schema inventories.
- Run
python scripts/check_triple_env.py --task <prgc|pure|asp|mt5|cnschema>to see which dependencies are present. Add--data-dir,--pretrained-model,--checkpoint, or--require-cudaonly when those resources are part of the user's requested run. - Validate dataset and config names with references/data-and-config.md before launching a native training or prediction script.
- Treat native PRGC/PURE/ASP/MT5 training, DeepSpeed inference, checkpoint downloads, Apex builds, and GPU-only runs as resource-dependent operations. Do not start them silently; confirm compute, data, and output paths first.
- For MT5 prediction conversion, prefer the bundled converter and inspect a few
kgrows before evaluating or submitting results.
Safety and verification stance
The bundled scripts are safe diagnostics or format converters. They do not train models, call remote APIs, download checkpoints, build Apex, or mutate source config files. Full PRGC/PURE/ASP/MT5 native training remains reference-only because it requires user-provided data, model weights, compatible CUDA/runtime variants, and potentially long-running jobs.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).