data-and-downloader
Configure NLTK data search paths, download only needed NLTK data packages, locate/load resources with nltk.data, use corpus readers, and recover safely from missing, corrupt, stale, or unsafe data archives.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- data-and-downloader
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Configure NLTK data search paths, download only needed NLTK data packages, locate/load resources with nltk.data, use corpus readers, and recover safely from missing, corrupt, stale, or unsafe data archives.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md8.5 KB
- 参考文档references/data-workflows.md9.0 KB
- 参考文档references/troubleshooting.md8.9 KB
- 脚本scripts/check_nltk_data.py10.5 KB
03 SKILL.md 正文
Data And Downloader
Use this sub-skill when the task is about NLTK data packages rather than NLP algorithm usage: selecting targeted data downloads, setting NLTK_DATA/nltk.data.path, checking nltk.data.find() and nltk.data.load(), using nltk.corpus readers, diagnosing missing or corrupt resources, or recovering from downloader/path security failures.
Route away from this sub-skill when the task is mainly about:
- Tokenization, POS tagging, stemming, lemmatization, or VADER scoring after data is available: use
../tokenize-tag-stem/SKILL.md. - Grammars, parsers, trees, chunkers, semantics, or inference APIs: use
../grammar-parse-semantics/SKILL.md. - Classifiers, language models, metrics, probability distributions, or translation/alignment algorithms: use
../ml-metrics-and-translation/SKILL.md.
Fast Paths
- Install only the packages required by the failing API; do not recommend broad
allunless the user explicitly wants the full collection. Common targeted packages:punkt_tab,averaged_perceptron_tagger_eng,averaged_perceptron_tagger_rus,wordnet,omw-2.0,vader_lexicon,universal_tagset,brown,treebank,reuters, andcomtrans. - Use
python -m nltk.downloader -d /path/to/nltk_data PKG...orimport nltk; nltk.download("PKG", download_dir="/path/to/nltk_data")for explicit downloads. Use-q/--quiet,-f/--force,-e/--exit-on-error, and-u/--urlonly when the task calls for them. - For portable projects, set
NLTK_DATA=/path/to/nltk_databefore Python starts, or prepend the directory at runtime withimport nltk.data; nltk.data.path.insert(0, "/path/to/nltk_data"). - Probe resources before running an algorithm:
nltk.data.find("tokenizers/punkt_tab/english/"),nltk.data.find("taggers/averaged_perceptron_tagger_eng/"),nltk.data.find("corpora/wordnet/"), ornltk.data.find("sentiment/vader_lexicon.zip/vader_lexicon/vader_lexicon.txt"). - Use corpus readers via
from nltk.corpus import brown, wordnet, reuters; start withfileids(),words(),sents(),tagged_words(),raw(),readme(), andcategories()where the reader supports them. - Treat
LookupErrormessages as package hints, but distinguish “package missing” from “package present but entry missing/corrupt”; stale/corrupt packages should be force-redownloaded into a controlled directory. - For recovery from untrusted data inputs, reject traversal-like resource names, do not unzip arbitrary archives into
nltk_data, and rely on the downloader’s validated extraction path instead of custom unsafe extraction.
Reference Map
- Targeted package workflows,
NLTK_DATAsetup, downloader commands, corpus reader recipes, and safe recovery patterns:references/data-workflows.md. - API signatures and resource/package map for
nltk.download,Downloader,nltk.data.find/load, CLI flags, and common corpus reader methods:references/api-reference.md. - LookupError diagnosis, read-only paths, proxy/network failures, stale/corrupt resources, package renames, and downloader/data security errors:
references/troubleshooting.md. - No-download checker for installed NLTK data paths and optional explicit download mode:
scripts/check_nltk_data.py.
Minimum Validation Pattern
- Print
nltk.__version__, Python version,NLTK_DATA, and the effectivenltk.data.pathbefore changing the environment. - Check exact resources with
nltk.data.find()or the bundled no-download script; avoid importing a corpus reader as proof unless you also call a method such asfileids()orwords()[:5]. - If a download is required, name explicit package IDs and use a controlled
download_dir; re-run a no-download check afterward. - For corpus workflows, assert representative outputs and supported methods: e.g.
brown.fileids(),brown.words(fileids="ca01"),brown.tagged_words(tagset="universal"),wordnet.synsets("dog"),reuters.categories(), orcomtrans.aligned_sents()[:1]when the package is installed. - For security-sensitive recovery, ensure malformed resource strings fail closed (
ValueError/LookupError) and archive extraction errors leave no partially trusted content to load.
Run the bundled checker from any current working directory after installing NLTK:
python /path/to/skills/disco/nltk/sub-skills/data-and-downloader/scripts/check_nltk_data.py --help
python /path/to/skills/disco/nltk/sub-skills/data-and-downloader/scripts/check_nltk_data.py --inspect
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).