# Text Classifier

> Classify text into predefined or custom categories. Use when agents need to route tickets, moderate content, categorize emails, or tag documents. Uses keyword matching and TF-IDF scoring. No external API needed.

- Skill: `kennyzir/text-classifier` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add kennyzir/text-classifier`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kennyzir/text-classifier/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: kennyzir (https://skillmd.com/u/kennyzir)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kennyzir/text-classifier

---


# Text Classifier

Classify text into categories using keyword matching and TF-IDF scoring. Supports 8 predefined categories (technology, business, science, health, sports, politics, entertainment, education) or custom categories you define.

## How It Works

1. Tokenize input text, remove stop words
2. Match against category keyword lists
3. Score using term frequency relative to text length
4. Return top category with confidence and ranked alternatives

## Use Cases

- Content moderation (flag inappropriate content)
- Ticket routing (assign support tickets to teams)
- Email categorization (inbox triage)
- Document tagging (auto-label content)
- News classification (topic detection)

## Prerequisites

1. **Sign up at [claw0x.com](https://claw0x.com)**
2. **Create API key** in Dashboard
3. **Set environment variable**: `export CLAW0X_API_KEY="ck_live_..."`

## Pricing

**FREE.** No charge per call.

- Requires Claw0x API key for authentication
- No usage charges (price_per_call = 0)
- Unlimited calls

## Example

**Input**:
```json
{
  "text": "The new GPU from NVIDIA delivers 2x performance for machine learning workloads, making it ideal for training large language models."
}
```

**Output**:
```json
{
  "category": "technology",
  "confidence": 85,
  "top_categories": [
    {"category": "technology", "score": 12.5},
    {"category": "business", "score": 2.1},
    {"category": "science", "score": 1.8}
  ]
}
```

## Error Codes

| Code | Meaning |
|------|---------|
| 400 | Text too short (<10 chars) or too long (>50K) |
| 401 | Missing or invalid API key |
| 500 | Classification failed (not billed) |

## About Claw0x

[Claw0x](https://claw0x.com) is the native skills layer for AI agents.

**GitHub**: [github.com/kennyzir/text-classifier](https://github.com/kennyzir/text-classifier)

