AGENT SKILL

textblob

Use TextBlob for Python text processing: tokenization, POS tagging, noun phrases, sentiment, lexical tools, classifiers, and extensions.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
textblob
license
MIT
metadata
{ "disco-role": "operating" }
description
Use TextBlob for Python text processing: tokenization, POS tagging, noun phrases, sentiment, lexical tools, classifiers, and extensions.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

TextBlob repo skill

Use this repo skill when a task names TextBlob or asks for a simple Python NLP workflow involving raw text, tokens, sentences, part-of-speech tags, noun phrases, sentiment, spelling, WordNet, word morphology, text classifiers, or TextBlob-compatible custom models.

Do not use this skill for large neural NLP training, transformer pipelines, spaCy pipeline components, annotation platforms, or LLM evaluation unless the request specifically needs TextBlob interoperability.

Setup first

TextBlob installs as a Python package, but many workflows require NLTK corpus data at runtime. In the target environment, a typical setup is:

python -m pip install -U textblob
python -m textblob.download_corpora lite   # default models and common basics
# Use the full command when ConllExtractor or NaiveBayesAnalyzer is needed:
python -m textblob.download_corpora

Minimal import and corpus diagnostic:

python scripts/check_textblob_setup.py --json
python scripts/check_textblob_setup.py --require-all-corpora

Read corpora and setup before debugging a MissingCorpusError, optional numpy issue, or corpus-backed workflow.

Route by task

User request Read
Tokenize text, split sentences, tag POS, extract noun phrases, compute sentiment, parse, count words/phrases, serialize sentence records, or use Blobber with built-in models core NLP workflows
Singularize/pluralize words, stem, lemmatize, correct spelling, inspect WordNet synsets/definitions, or normalize word lists word and lexical tools
Train/evaluate/update Naive Bayes, Decision Tree, MaxEnt, or Positive Naive Bayes classifiers; load CSV/JSON/TSV training data; write feature extractors; register data formats classifiers and data formats
Implement custom tokenizers, POS taggers, NP extractors, sentiment analyzers, parsers, language/model extensions, or shared Blobber factories custom models and extensions

Shared references:

  • API map: package/module routing and public API family overview.
  • Corpora and setup: install commands, corpus names, optional dependencies, and setup verification.
  • Troubleshooting: cross-cutting install, import, corpus, and version issues.
  • Repository provenance: source snapshot used to build this skill and refresh criteria.

Common decision points

  • If raw text still needs tokenization, sentence splitting, tags, sentiment, or noun phrases, start with the core NLP sub-skill before moving to word-level or classifier workflows.
  • If a classifier task includes file formats, labels, updates, or feature extraction, use the classifier sub-skill even if the final classifier is used through TextBlob(..., classifier=cl).
  • If a request says "custom tokenizer/tagger/analyzer/parser" or mentions an extension package, use the custom-model sub-skill for interface validation, then return to core NLP for ordinary TextBlob usage.
  • If a workflow fails only because corpus data is absent, do not change model selection silently. Run explicit corpus setup in the target environment and rerun the relevant smoke script.

Quick sanity examples

from textblob import TextBlob, Word

blob = TextBlob("TextBlob is amazingly simple. Great fun!")
print(blob.sentiment)
print([(str(word), tag) for word, tag in blob.tags])
print(blob.noun_phrases)

print(Word("speling").correct())

Classifier example:

from textblob import TextBlob
from textblob.classifiers import NaiveBayesClassifier

train = [("I love this", "pos"), ("This is awful", "neg")]
cl = NaiveBayesClassifier(train)
blob = TextBlob("I love this API. This bug is awful.", classifier=cl)
for sentence in blob.sentences:
    print(sentence, sentence.classify())

When these examples fail, first run python scripts/check_textblob_setup.py and then follow the nearest sub-skill troubleshooting reference.

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