技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
classifiers-and-data-formats【数据与研究】Build, evaluate, update, and debug TextBlob classifiers and their CSV, JSON, TSV, and custom training data formats.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is about training, evaluating, updating, or debugging a textblob.classifiers classifier, or when classifier training/test data must be loaded from CSV, JSON, TSV, or a registered custom format.
python scripts/classifier_smoke.py --help.NaiveBayesClassifier, DecisionTreeClassifier, MaxEntClassifier, PositiveNaiveBayesClassifier, and NLTKClassifier wrappers.basic_extractor, contains_extractor, and custom one-argument or two-argument extractors.[(text_or_tokens, label), ...], opened file-like data, CSV text,label, JSON arrays with text and label, TSV, and custom registered formats.classify, prob_classify, accuracy, update, labels, informative_features, show_informative_features, pretty_format, and pseudocode.TextBlob(..., classifier=cl) workflows, including sentence-level .classify() on blobs created with the same classifier.textblob.formats.detect, get_registry, register, and common FormatError / ValueError handling.NaiveBayesAnalyzer as a sentiment analyzer is covered by core NLP workflows. It is classifier-backed, but its operating surface is TextBlob(..., analyzer=NaiveBayesAnalyzer()).sentiment, not custom classifier training.NLTKClassifier only when wrapping a concrete nltk.classify class.(document, label) pairs where document is either a string or a list of tokens. Keep labels consistent ("pos"/"neg", booleans, or other labels, but not a mixture unless that is intentional).format="csv", "json", or "tsv" explicitly for reliability.classify() on known examples, accuracy() on held-out data, and labels() to confirm the label set. For Naive Bayes or MaxEnt, use prob_classify() when probabilities matter.update() expects normalized in-memory examples. If new data arrives as CSV/JSON/TSV, parse it into a list first, validate labels, then call update().classifier=cl to TextBlob or Blobber; then blob.classify() classifies the full blob and each sentence object created from that blob shares the same classifier.informative_features() / show_informative_features() or Decision Tree pretty_format() / pseudocode() when a user needs reasons, audits, or debugging clues.If a workflow fails, first check the symptom table in troubleshooting, then inspect the exact data schema in data formats. Use the bundled smoke script for a package-level sanity check:
python scripts/classifier_smoke.py --json
python scripts/classifier_smoke.py --skip-decision-tree