Classify text or CSV files into preset or custom categories with optional confidence scores and batch processing, using AI-powered classification.
# SKILL.md - Text Classifier
> Upload text or CSV — AI automatically classifies content and returns structured labels with confidence scores.
**Slug:** text-classifier
## Tiered Features
| Feature | FREE | PRO |
|---------|:----:|:---:|
| Text input | ✅ | ✅ |
| File upload (TXT/CSV) | ❌ | ✅ |
| Preset classifiers | 3 | Unlimited |
| Custom labels | ❌ | ✅ |
| Confidence score | ❌ | ✅ |
| Batch processing | ❌ | ✅ (up to 5,000) |
| History retention | ❌ | ✅ (365 days) |
| Daily classifications | 20 | Unlimited |
## Pricing
**Per-call:** $0.01 USDT per classification
No monthly subscription. Pay only for what you use.
## Usage
### Web Interface (Recommended)
```bash
cd text-classifier
pip install -r requirements.txt
python scripts/web_app.py
# Open http://localhost:5000
```
### CLI
```bash
# Single text classification
python -m scripts.classifier --text "This product is great" --classifier "Sentiment Classification" --api-key "sk-..."
# Batch CSV classification
python -m scripts.classifier --file data.csv --classifier "Sentiment Classification" --api-key "sk-..." --output csv --output-path results.csv
# Custom labels
python -m scripts.classifier --text "Urgent issue" --custom-labels "High,Medium,Low" --custom-prompt "Classify priority" --api-key "sk-..."
```
### Python API
```python
from scripts.classifier import classify_text, validate_token
# Token validation
tier = validate_token("PRO-xxxx")
print(f"Tier: {tier}")
# Single classification
result = classify_text(
text="This product is excellent",
classifier_name="Sentiment Classification",
api_key="sk-...",
show_confidence=True
)
print(result)
# {'label': 'Positive', 'confidence': 0.85, 'raw': 'Positive', ...}
```
## Preset Classifiers
- **Intent Classification**: Inquiry / Complaint / Refund / Cooperation
- **Sentiment Classification**: Positive / Neutral / Negative
- **Industry Classification**: Finance / Healthcare / Education / Retail / Manufacturing
- **Risk Classification**: Compliant / Violation / Suspicious
- **Priority Classification**: High / Medium / Low
- **Content Classification**: News / Advertisement / UGC / Spam
## Required Environment Variables
```bash
SKILL_BILLING_API_KEY # Your SkillPay Builder API Key
SKILL_BILLING_SKILL_ID # Skill slug: text-classifier
```
Set these in your runtime environment. Without them, the tool runs in Dev Mode (FREE tier, no billing).
## Billing
This skill uses **SkillPay** (skillpay.me) for per-call billing at **$0.01 USDT per classification**.
- Your Feishu User ID (Open ID) is transmitted to `skillpay.me` exclusively for billing purposes
- No other data is transmitted to third parties
- Billing occurs at the start of each classification (after API key validation)
- Dev Mode (`SKILL_BILLING_API_KEY` not set): FULL FREE USAGE — no API key required, no billing
## Security Notes
- **LLM Execution**: All AI classification runs via OpenAI API you configure
- **Data Isolation**: Classification history is stored locally in `/tmp/text-classifier/` — no data leaves your environment
- **SQL Safety**: Not applicable (no database queries in this skill)
- **Path Isolation**: All writes go to `/tmp/` — no home directory access
## Dependencies
```
requests>=2.28.0
pandas>=2.0.0
openpyxl>=3.0.0
flask>=3.0.0
```
don't have the plugin yet? install it then click "run inline in claude" again.
by @clawhub