AGENT SKILL

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

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 all unless 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, and comtrans.
  • Use python -m nltk.downloader -d /path/to/nltk_data PKG... or import nltk; nltk.download("PKG", download_dir="/path/to/nltk_data") for explicit downloads. Use -q/--quiet, -f/--force, -e/--exit-on-error, and -u/--url only when the task calls for them.
  • For portable projects, set NLTK_DATA=/path/to/nltk_data before Python starts, or prepend the directory at runtime with import 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/"), or nltk.data.find("sentiment/vader_lexicon.zip/vader_lexicon/vader_lexicon.txt").
  • Use corpus readers via from nltk.corpus import brown, wordnet, reuters; start with fileids(), words(), sents(), tagged_words(), raw(), readme(), and categories() where the reader supports them.
  • Treat LookupError messages 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_DATA setup, 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

  1. Print nltk.__version__, Python version, NLTK_DATA, and the effective nltk.data.path before changing the environment.
  2. 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 as fileids() or words()[:5].
  3. If a download is required, name explicit package IDs and use a controlled download_dir; re-run a no-download check afterward.
  4. 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(), or comtrans.aligned_sents()[:1] when the package is installed.
  5. 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351