Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By cardmagicv1.0.0LGPL-2.1
Classifies text as spam, sentiment or emotion with pre-trained models, or trains your own classifier from labeled examples.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
Executables (bin/) — files in this plugin's bin/ directory are added to the Bash tool's PATH while the plugin is enabled.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
text-classification, nlp, machine-learning, sentiment-analysis, tf-idf, bayesian, ruby-gem, lsi ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Text classification in Ruby. Five algorithms, native performance, streaming support.
Reference · Documentation · Tutorials · API Reference
| This Gem | Other Forks | |
|---|---|---|
| Algorithms | ✅ 4 classifiers + TF-IDF vectorization | ❌ 2 classifiers only |
| Command line | ✅ classifier and keywords commands | ❌ No executables |
| Incremental LSI | ✅ Brand's algorithm (no rebuild) | ❌ Full SVD rebuild on every add |
| LSI Performance | ✅ Native C extension (5-50x faster) | ❌ Pure Ruby or requires GSL |
| Streaming | ✅ Train on multi-GB datasets | ❌ Must load all data in memory |
| Persistence | ✅ Pluggable (file, Redis, S3, SQL, Custom) | ❌ Marshal only |
gem 'classifier'
Or install via Homebrew for CLI-only usage:
brew install classifier
Classify text instantly with pre-trained models. No code required:
# Detect spam
classifier -r sms-spam-filter "You won a free iPhone"
# => spam
# Analyze sentiment
classifier -r imdb-sentiment "This movie was absolutely amazing"
# => positive
# Detect emotions
classifier -r emotion-detection "I am so happy today"
# => joy
# List all available models
classifier models
Train your own model:
# Train from files
classifier train positive reviews/good/*.txt
classifier train negative reviews/bad/*.txt
# Classify new text
classifier "Great product, highly recommend"
# => positive
The keywords command scores term importance with TF-IDF. It has no
pre-trained models, so build a vocabulary first. Every later command reads
that model:
# Fit from multiple files. Each line becomes a separate document.
keywords fit corpus/*.txt
# => Saved to "/path/to/keywords.json"
# Fit from stdin
cat documents.txt | keywords fit
# Tune the vocabulary filters during the fit
keywords fit --min-df 2 --max-df 0.85 --ngram 1,2 corpus/*.txt
Then score any text against that vocabulary:
# Score a raw string
keywords "Ruby is a programming language"
# => language:0.58 programming:0.58 ruby:0.58
# Score a file
keywords extract article.txt
# => machine:0.58 network:0.47 neural:0.47 learning:0.47
# Pipeline with stdin and web data
curl -s https://example.com/article | keywords extract
# Get the top 5 terms only
keywords -n 5 "long document with many terms..."
# Use a different model file
keywords -m custom_model.json "Ruby is a programming language"
Inspect the model:
keywords info
# => Documents: 1,234
# => Vocabulary: 5,678
# => Min DF: 1
# => Max DF: 1.0
The output maps stems back to whole words, so a model built from programming
prints programming, not program. An n-gram label joins its parts with a
space, as in machine learning:0.35.
Run keywords --help for the full option list. A usage error exits 2 and any
other error exits 1, so scripts can tell the two apart.
Run the two commands side by side to read a label together with the terms that make the text distinctive:
classifier -f reviews-model.json -p "Broken on arrival, awful quality"
# => positive:0.12 negative:0.88
keywords -m reviews.json -n 5 "Broken on arrival, awful quality"
# => awful:0.52 arrival:0.52 broken:0.52 quality:0.44
They keep separate models in separate formats, so classifier takes -f and
keywords takes -m, and neither reads the other's file. The terms are
context, not an explanation of the label: TF-IDF measures how well a term
separates a document from its corpus, not how much it favors a category.
Using both commands → · keywords reference → · CLI Guide →
Install as a plugin to get skills (auto-invoked) and slash commands:
# Add the marketplace
claude plugin marketplace add cardmagic/ai-marketplace
# Install the plugin
claude plugin install classifier@cardmagic
This gives you:
/classifier:classify, /classifier:train, /classifier:modelsBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (cardmagic/classifier) — no native marketplace selected
npx claudepluginhub p/cardmagic-classifierPlugins from other owners that cover similar ground