nlp-and-generation
Use Libra for text classification, summarization, named entity recognition, GPT-2 text generation, image captioning, and NLTK/TextBlob runtime setup.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- nlp-and-generation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Libra for text classification, summarization, named entity recognition, GPT-2 text generation, image captioning, and NLTK/TextBlob runtime setup.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/api-reference.md2.8 KB
- 参考文档references/data-formats.md1.6 KB
- 参考文档references/runtime-setup.md1.4 KB
- 参考文档references/troubleshooting.md1.9 KB
- 参考文档references/workflows.md2.1 KB
- 脚本scripts/prepare_nltk_corpora.py3.0 KB
- 脚本scripts/smoke_text_generation.py3.0 KB
03 SKILL.md 正文
NLP and Generation with Libra
Load this sub-skill when the task uses Libra's text and language-generation APIs: sentiment/text classification, summarization, GPT-2 text generation, named entity recognition, image captioning, vocabulary inspection, or NLTK/TextBlob runtime setup.
What this sub-skill owns
text_classification_query(...)andclassify_text(...)summarization_query(...)andget_summary(...)generate_text(...)named_entity_query(...)image_caption_query(...)andgenerate_caption(...)- NLTK corpora, TextBlob/POS-tagging assumptions, HuggingFace/TensorFlow model downloads, and NLP preprocessing helper behavior
Trigger phrases
Use this route when a user asks to:
- train a sentiment or text classifier from a CSV and classify new text
- fine-tune or use summarization on text/summary pairs
- generate text from a file or prefix prompt
- detect named entities in a text column
- caption images from a CSV of image paths and captions
- fix missing NLTK corpora, TextBlob tagging, or HuggingFace model download failures
Bundled references
references/api-reference.mdfor methods, model keys, and parametersreferences/workflows.mdfor end-to-end recipesreferences/data-formats.mdfor text, summary, generation, NER, and captioning data shapesreferences/runtime-setup.mdfor NLTK, TextBlob, transformers, and optional GPU setupreferences/troubleshooting.mdfor common NLP/generation failures
Bundled scripts
scripts/prepare_nltk_corpora.pychecks required corpora and can optionally download them when network access is explicitly allowed.scripts/smoke_text_generation.pychecks thegenerate_textAPI surface without forcing a GPT-2 download by default.
Operating notes
client.__init__downloads NLTKpunkt,averaged_perceptron_tagger, andstopwords; patch it only for non-NLP smoke checks that do not need corpora.text_classification_querydefaults to label columnlabel;summarization_querydefaults to label columnsummary.generate_text(file_data=True)reads theclientdataset path as a text file. Usefile_data=False, prefix="..."when the user wants prompt-only generation.- Transformer workflows load HuggingFace models and can require network/cache access. State this before running them.
- Image captioning is owned here because the public API lives with the NLP queries, but image-path/layout debugging should also consult
sub-skills/vision-and-generative.
Cross-links
- Use the root skill for global install and pandas compatibility shims.
- Route tabular model selection and
analyze()/plot workflows tosub-skills/tabular-modelingunless the model key is NLP-specific. - Route image classification, CNN export, GANs, and image dataset layout checks to
sub-skills/vision-and-generative.
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).