---
title: classifications | CodeWeaver Docs
description: API reference for codeweaver.semantic.classifications
url: "https://docs.knitli.com/api/semantic/classifications"
type: static
generatedAt: "2026-04-17T17:21:09.546Z"
---

# classifications
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/semantic/classifications.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F&text=classifications)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F&text=classifications)[Share on Bluesky](https://bsky.app/intent/compose?text=classifications%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F&title=classifications)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F&t=classifications)[Share on Email](mailto:?subject=classifications&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F)[Share on WhatsApp](https://wa.me/?text=classifications%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fsemantic%2Fclassifications%2F&text=classifications)
# `codeweaver.semantic.classifications`
[Section titled “codeweaver.semantic.classifications”](#codeweaversemanticclassifications)
Complete implementation specification for CodeWeaver’s new semantic categorization system based on language workbench methodology with multi-dimensional importance scoring.

## Class: `AgentTask`
[Section titled “Class: AgentTask”](#class-agenttask)
Dataclass-based agent task with context weight profile.

Values are `BaseAgentTask` dataclass instances.

### Method: `profiles`
[Section titled “Method: profiles”](#method-profiles)

**

```
profiles()
```

Get the context weight profiles for all tasks.

## Class: `BaseAgentTask`
[Section titled “Class: BaseAgentTask”](#class-baseagenttask)
Base class for agent tasks with context weight profiles.

## Class: `ImportanceRank`
[Section titled “Class: ImportanceRank”](#class-importancerank)
Semantic importance rankings from highest to lowest priority.

These are general guidelines. The actual importance depends on the task and context, but these serve as a useful baseline.

### Method: `from_classification`
[Section titled “Method: from_classification”](#method-from_classification)

**

```
from_classification()
```

Get semantic importance rank for a given classification.

### Method: `from_token_purpose`
[Section titled “Method: from_token_purpose”](#method-from_token_purpose)

**

```
from_token_purpose()
```

Map token purpose to an approximate importance rank.

## Class: `ImportanceScores`
[Section titled “Class: ImportanceScores”](#class-importancescores)
Multi-dimensional importance scoring for AI assistant contexts.

### Method: `as_dict`
[Section titled “Method: as_dict”](#method-as_dict)

**

```
as_dict()
```

Convert importance scores to a dictionary format.

### Method: `default`
[Section titled “Method: default”](#method-default)

**

```
default()
```

Get default importance scores.

### Method: `for_task`
[Section titled “Method: for_task”](#method-for_task)

**

```
for_task()
```

Get importance scores adjusted for a specific agent task context.

### Method: `from_dict`
[Section titled “Method: from_dict”](#method-from_dict)

**

```
from_dict()
```

Create ImportanceScores from a dictionary format.

### Method: `weighted_score`
[Section titled “Method: weighted_score”](#method-weighted_score)

**

```
weighted_score()
```

Calculate weighted importance score for given AI assistant context.

## Class: `ImportanceScoresDict`
[Section titled “Class: ImportanceScoresDict”](#class-importancescoresdict)
Typed dictionary for context weights in AI assistant scenarios.

`ImportanceScoresDict` is the python-serialized and mutable version of `ImportanceScores`.

## Class: `ScoreValidation`
[Section titled “Class: ScoreValidation”](#class-scorevalidation)
Validation results for importance score accuracy.

## Class: `SemanticClass`
[Section titled “Class: SemanticClass”](#class-semanticclass)
Language-agnostic semantic categories for AST nodes.

### Method: `add_language_member`
[Section titled “Method: add_language_member”](#method-add_language_member)

**

```
add_language_member()
```

Add a new language-specific semantic category.

### Method: `categories`
[Section titled “Method: categories”](#method-categories)

**

```
categories()
```

Get mapping of categories to their ThingClass definitions.

### Method: `from_token_purpose`
[Section titled “Method: from_token_purpose”](#method-from_token_purpose-1)

**

```
from_token_purpose()
```

Map token purpose to an approximate semantic category.

### Method: `rank_map`
[Section titled “Method: rank_map”](#method-rank_map)

**

```
rank_map()
```

Get mapping of categories to their semantic ranks.

## Class: `SemanticClassDict`
[Section titled “Class: SemanticClassDict”](#class-semanticclassdict)
Typed dictionary for semantic category definitions.

## Class: `ThingClass`
[Section titled “Class: ThingClass”](#class-thingclass)
Universal semantic category for AST nodes.

### Method: `validate_importance_scores`
[Section titled “Method: validate_importance_scores”](#method-validate_importance_scores)

**

```
validate_importance_scores()
```

Ensure importance_scores is a ImportanceScoresDict.

### Method: `validate_name`
[Section titled “Method: validate_name”](#method-validate_name)

**

```
validate_name()
```

Ensure name is a SemanticClass.

## Class: `UsageMetrics`
[Section titled “Class: UsageMetrics”](#class-usagemetrics)
Metrics on real-world usage of semantic categories.

### Method: `add_uses`
[Section titled “Method: add_uses”](#method-add_uses)

**

```
add_uses()
```

Add usage counts for a list of categories.