snips-nlu
Use Snips NLU for intent parsing, slot filling, dataset/resource preparation, engine API workflows, CLI training/parsing, and troubleshooting.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- snips-nlu
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Snips NLU for intent parsing, slot filling, dataset/resource preparation, engine API workflows, CLI training/parsing, and troubleshooting.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/installation-and-resources.md4.4 KB
- 参考文档references/repo-provenance.md2.7 KB
- 参考文档references/repo-routing-metadata.json432 B
- 参考文档references/troubleshooting.md4.5 KB
- 脚本scripts/check_snips_nlu_environment.py5.8 KB
03 SKILL.md 正文
Snips NLU
Use this repo skill when a task involves Snips NLU (snips-nlu / snips_nlu) for classical natural-language understanding: intent classification, slot filling, YAML/JSON dataset authoring, language resources, Python engine APIs, CLI training/parsing, metrics, or persisted NLU engine artifacts.
This skill targets Snips NLU 0.20.2 and model format 0.20.0.
Quick setup and health checks
Install the public package in a compatible Python environment:
pip install snips-nlu
python -m snips_nlu --help
python -m snips_nlu version
python -m snips_nlu model-version
For this old release, prefer Python 3.8 when modern Python versions cannot resolve pinned compiled dependencies. Read references/installation-and-resources.md for install/resource details and references/troubleshooting.md for cross-cutting failures.
Run the bundled read-only environment check when diagnosing setup:
python scripts/check_snips_nlu_environment.py --json
If the workflow needs language resources, download or link them explicitly; helpers in this skill do not perform network downloads silently:
python -m snips_nlu download en
python scripts/check_snips_nlu_environment.py --resource en --json
Route by task
| Task | Read |
|---|---|
| Create or validate a Snips NLU YAML/JSON dataset, inspect entity schemas, convert YAML to JSON, or reason about supported languages/resources. | sub-skills/dataset-and-resources/SKILL.md |
Use Python APIs such as SnipsNLUEngine, fit, parse, get_intents, get_slots, persist, from_path, configs, random seeds, or result schemas. |
sub-skills/engine-api/SKILL.md |
Build or troubleshoot snips-nlu / python -m snips_nlu commands for generate-dataset, train, parse, download, link, versions, or metrics. |
sub-skills/cli-workflows/SKILL.md |
| Decide whether this generated skill is current for a checkout/version. | references/repo-provenance.md |
Common workflow map
- Author data: use
dataset-and-resourcesto write YAML intent/entity files or JSON datasets. - Validate/convert: use bundled dataset scripts before training.
- Prepare resources: use CLI download/link commands only when network/resource setup is approved.
- Train and parse: use either the Python engine API (
engine-api) or CLI command recipes (cli-workflows). - Persist and reload: use
engine-apifor artifact layout, model-version compatibility, and safe persistence checks. - Evaluate: use
cli-workflowsfor metrics commands and optionalsnips-nlu-metricsdependency notes.
Important API and CLI anchors
Verified public API signatures include:
SnipsNLUEngine(config=None, **shared)SnipsNLUEngine.fit(dataset, force_retrain=True)SnipsNLUEngine.parse(text, intents=None, top_n=None)SnipsNLUEngine.get_intents(text)andget_slots(text, intent)SnipsNLUEngine.persist(path)andSnipsNLUEngine.from_path(path, **shared)Dataset.from_yaml_files(language, filenames)validate_and_format_dataset(dataset)load_resources(name, required_resources=None)
Verified CLI commands include generate-dataset, train, parse, download, download-all-languages, download-entity, download-language-entities, link, cross-val-metrics, train-test-metrics, version, and model-version.
Boundaries and safety
- Do not treat this as a modern LLM or neural sequence-model training skill; Snips NLU is a classical NLU package for intent/slot extraction.
- Do not assume package install success on Python 3.11+ for Snips NLU
0.20.x; use compatibility troubleshooting first. - Do not run network resource downloads, long metrics sweeps, or training against user data unless the user requested those side effects.
- Do not rely on original repository docs, tests, or sample files at runtime; this skill bundles the needed references and helper scripts.
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).