# Content Classification

> Classify documents by subject using keyword matching and text analysis

- **Type:** Skill
- **Install:** `agentstack add skill-cxcscmu-skilllearnbench-content-classification`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [cxcscmu](https://agentstack.voostack.com/s/cxcscmu)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [cxcscmu](https://github.com/cxcscmu)
- **Source:** https://github.com/cxcscmu/SkillLearnBench/tree/main/skills/b1-one-shot-claude-haiku-4-5/organize-messy-files/content-classification
- **Website:** https://cxcscmu.github.io/SkillLearnBench

## Install

```sh
agentstack add skill-cxcscmu-skilllearnbench-content-classification
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Document Content Classification

## Overview
Classify extracted text into one of 5 subject categories using keyword-based analysis.

## Subject Categories and Keywords

### 1. LLM (Large Language Models)
Keywords: transformer, BERT, GPT, language model, attention mechanism, token, embedding, fine-tuning, prompt, neural network, deep learning, NLP, natural language processing

### 2. Trapped Ion and Quantum Computing
Keywords: trapped ion, quantum computing, qubit, quantum gate, quantum circuit, ion trap, quantum algorithm, quantum error correction, quantum entanglement, quantum state

### 3. Black Hole
Keywords: black hole, event horizon, singularity, gravitational, spacetime, Hawking radiation, accretion disk, neutron star, gravitational wave, relativistic

### 4. DNA
Keywords: DNA, gene, genome, genomics, protein, mutation, sequencing, nucleotide, chromosome, genetic, CRISPR, RNA, molecular biology

### 5. Music History
Keywords: music, composer, symphony, opera, musical, concert, melody, harmony, rhythm, baroque, classical, romantic, jazz, folk, baroque, beethoven, mozart, wagner

## Classification Algorithm

```python
def classify_document(text):
    """Classify document based on keyword frequency"""

    keywords = {
        'LLM': ['transformer', 'bert', 'gpt', 'language model', 'attention', 'token', 'embedding', 'fine-tuning', 'prompt', 'nlp'],
        'trapped_ion_and_qc': ['trapped ion', 'quantum', 'qubit', 'quantum gate', 'ion trap', 'quantum algorithm'],
        'black_hole': ['black hole', 'event horizon', 'singularity', 'hawking', 'gravitational', 'spacetime'],
        'DNA': ['dna', 'gene', 'genome', 'genomics', 'protein', 'mutation', 'sequencing', 'nucleotide', 'crispr'],
        'music_history': ['music', 'composer', 'symphony', 'opera', 'melody', 'harmony', 'baroque', 'classical', 'mozart', 'beethoven']
    }

    text_lower = text.lower()
    scores = {}

    for category, words in keywords.items():
        score = 0
        for word in words:
            # Count occurrences (case-insensitive)
            score += text_lower.count(word)
        scores[category] = score

    # Return category with highest score
    best_category = max(scores, key=scores.get)

    # If all scores are 0, default to music_history (catch-all)
    if scores[best_category] == 0:
        return 'music_history'

    return best_category

def get_classification_confidence(text, category):
    """Return confidence score (0-1) for a classification"""
    keywords = {
        'LLM': ['transformer', 'bert', 'gpt', 'language model', 'attention'],
        'trapped_ion_and_qc': ['quantum', 'qubit', 'ion trap'],
        'black_hole': ['black hole', 'event horizon'],
        'DNA': ['dna', 'gene', 'genome'],
        'music_history': ['music', 'composer', 'symphony']
    }

    text_lower = text.lower()
    score = sum(text_lower.count(word) for word in keywords.get(category, []))

    # Normalize to 0-1 range
    max_possible = len(keywords.get(category, [])) * 10
    return min(score / max_possible, 1.0) if max_possible > 0 else 0
```

## Best Practices
- Use case-insensitive matching
- Count keyword occurrences, not just presence
- Handle edge cases with a default category
- Consider confidence scores for ambiguous documents
- Prioritize more specific keywords over generic ones

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [cxcscmu](https://github.com/cxcscmu)
- **Source:** [cxcscmu/SkillLearnBench](https://github.com/cxcscmu/SkillLearnBench)
- **License:** MIT
- **Homepage:** https://cxcscmu.github.io/SkillLearnBench

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-cxcscmu-skilllearnbench-content-classification
- Seller: https://agentstack.voostack.com/s/cxcscmu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
