Subject Classifier

Maps extracted text to one of the 5 defined subjects.

cxcscmu Updated

File contents

Subject Classifier Skill

Classifies text into: LLM, trapped_ion_and_qc, black_hole, DNA, or music_history.

Usage

def classify(text):
    text = text.lower()
    mapping = {
        'LLM': ['language model', 'transformer', 'attention', 'gpt', 'llm'],
        'trapped_ion_and_qc': ['trapped ion', 'quantum computer', 'qubit', 'entanglement'],
        'black_hole': ['black hole', 'event horizon', 'singularity'],
        'DNA': ['dna', 'genome', 'protein', 'gene', 'sequencing']
    }
    for category, keywords in mapping.items():
        if any(keyword in text for keyword in keywords):
            return category
    return 'music_history'

cxcscmu/SkillLearnBench commit 28c709ca44

Frequently asked questions

npx get-skill add cxcscmu/subject-classifier