---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Code examples](/recipes)
3.  Hierarchical Classification

Back to code examples

Concepts

# Hierarchical Classification

Assign content to multi-level category hierarchies using embedding-based classification. Define your taxonomy once, then classify new content automatically with confidence scores.

video

image

text

Multi-Tier

[Run in Builder](/build?recipe=hierarchical-classification)

"Show all educational tutorial videos classified under safe content with high confidence"

### Why This Matters

Taxonomies are organizational infrastructure. Once defined, they enable consistent classification, compliance tagging, and structured navigation across all content.

Python

cURL

import requests

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="content-classification")

API \= "https://api.mixpeek.com/v1"

HEADERS \= {"Authorization": "Bearer YOUR\_API\_KEY", "X-Namespace": "content-classification"}

\# 1. One exemplar collection per node of the hierarchy

safe\_bucket \= client.buckets.create(

    bucket\_name\="safe-examples",

    bucket\_schema\={"properties": {"image": {"type": "image"}}},

)

safe \= client.collections.create(

    collection\_name\="safe-examples",

    source\={"type": "bucket", "bucket\_ids": \[safe\_bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

    },

)

edu\_bucket \= client.buckets.create(

    bucket\_name\="educational-examples",

    bucket\_schema\={"properties": {"image": {"type": "image"}}},

)

edu \= client.collections.create(

    collection\_name\="educational-examples",

    source\={"type": "bucket", "bucket\_ids": \[edu\_bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

    },

)

client.buckets.upload(

    safe\_bucket\["bucket\_id"\],

    blobs\=\[{"property": "image", "type": "image", "data": "s3://your-bucket/examples/safe/0001.jpg"}\],

)

client.buckets.upload(

    edu\_bucket\["bucket\_id"\],

    blobs\=\[{"property": "image", "type": "image", "data": "s3://your-bucket/examples/educational/0001.jpg"}\],

)

client.collections.trigger(safe\["collection\_id"\])

client.collections.trigger(edu\["collection\_id"\])

\# 2. The retriever that matches a document against the exemplars

matcher \= client.retrievers.create(

    retriever\_name\="example-matcher",

    collection\_identifiers\=\["safe-examples", "educational-examples"\],

    input\_schema\={"query": {"type": "text", "required": True}},

    stages\=\[

        {

            "stage\_name": "search",

            "stage\_id": "feature\_search",

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/vertex\_multimodal\_embedding",

                        "query": {"input\_mode": "text", "value": "{{INPUT.query}}"},

                        "top\_k": 3,

                    },

                \],

                "final\_top\_k": 3,

            },

        },

    \],

)

\# 3. A hierarchical taxonomy: Educational sits under Safe. The SDK has no

\#    taxonomies resource, so this part is REST.

taxonomy \= requests.post(API + "/taxonomies", headers\=HEADERS, json\={

    "taxonomy\_name": "content-classification",

    "config": {

        "taxonomy\_type": "hierarchical",

        "retriever\_id": matcher\["retriever\_id"\],

        "input\_mappings": \[{"input\_key": "query", "source\_type": "payload", "path": "description"}\],

        "hierarchical\_nodes": \[

            {"collection\_id": safe\["collection\_id"\], "label": "Safe"},

            {"collection\_id": edu\["collection\_id"\], "parent\_collection\_id": safe\["collection\_id"\], "label": "Educational"},

        \],

    },

}).json()

\# 4. The content collection writes one set of fields per tier onto every document

bucket \= client.buckets.create(

    bucket\_name\="videos",

    bucket\_schema\={"properties": {"video": {"type": "video"}}},

)

videos \= client.collections.create(

    collection\_name\="videos",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

        "parameters": {

            "split\_method": "scene",

            "run\_video\_description": True,

        },

    },

    taxonomy\_applications\=\[{"taxonomy\_id": taxonomy\["taxonomy\_id"\], "execution\_mode": "materialize", "hierarchical\_enrichment\_style": "full\_chain"}\],

)

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "video", "type": "video", "data": "s3://your-bucket/videos/chemistry-lesson.mp4"}\],

)

client.collections.trigger(videos\["collection\_id"\])

docs \= client.documents.list(videos\["collection\_id"\], page\_size\=20)

for doc in docs\["results"\]:

    print(doc\["document\_id"\], {k: v for k, v in doc.items() if "tier" in k})

### Feature Extractors

Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

### Retriever Stages

### Resources Used

Taxonomy

[

Content Taxonomy

Multi-level classification hierarchy with confidence thresholds

Multi-level classification hierarchy with confidence thresholds



](https://mixpeek.com/docs/enrichment/taxonomies)

### Documentation

[Taxonomies](https://mixpeek.com/docs/enrichment/taxonomies)

## Use Cases Using This Recipe

Intermediate

Coming Soon

8 min

### Product Affordance Intelligence

Understand what products can do, not just what they look like

+35% improvement

Search relevance (NDCG)

[

ecommerce

](/solutions/ecommerce)

Who It's For

E-commerce platforms, product catalog managers, and merchandising teams managing 100K+ SKU catalogs

[View Details](/use-cases/product-affordance-intelligence)

Advanced

Coming Soon

9 min

### AdTech Creative Intelligence

Understand what makes ad creatives perform before they run

Scored at upload

Creative approval

[

creative dna

](/solutions/creative-dna)[

advertising

](/solutions/advertising)

Who It's For

Ad networks, DSPs, creative agencies, and brand marketing teams managing 10K+ creative assets monthly

[View Details](/use-cases/adtech-creative-intelligence)

Advanced

Coming Soon

7 min

### Government Intelligence

Multimodal search and analysis for government document repositories

100% unified index

Cross-department search coverage

[

legal

](/solutions/legal)

Who It's For

Government agencies, policy researchers, compliance teams, and public affairs professionals managing multi-department document repositories

[View Details](/use-cases/government-intelligence)

Beginner

Coming Soon

7 min

### Asset Intelligence (DAM Auto-Labeling)

Auto-tag and organize digital assets with multimodal AI

Labels written on upload, from one taxonomy

Tagging

[

dam intelligence

](/solutions/dam-intelligence)[

advertising

](/solutions/advertising)[

entertainment

](/solutions/entertainment)

Who It's For

Creative teams, brand managers, and media companies managing 100K+ digital assets across DAM platforms

[View Details](/use-cases/dam-auto-labeling)

Intermediate

### AI Content Moderation for User-Generated Content

Automatically detect and flag policy-violating content across text, images, and video

95%+ of violations flagged before going live

Pre-publication violation catch rate

media

Who It's For

UGC platforms, social media companies, marketplace operators, and community platforms processing 100K+ daily uploads requiring trust and safety review

[View Details](/use-cases/ai-content-moderation-ugc)

Beginner

### AI-Powered Digital Asset Management

Search, organize, and enrich your media library with multimodal AI

80% faster search-to-find

Asset discovery time

media

Who It's For

Media companies, creative agencies, brand teams, and publishers managing libraries of 500K+ images, videos, and documents across production workflows

[View Details](/use-cases/ai-digital-asset-management)

Intermediate

### Automated Video Tagging for Streaming

Auto-generate rich metadata for every scene, shot, and moment in your catalog

10x more tags than manual editorial process

Metadata tags per title

[

entertainment

](/solutions/entertainment)

Who It's For

Streaming platforms, content distributors, and VOD services managing catalogs of 10K+ titles that need rich metadata for discovery and recommendation

[View Details](/use-cases/automated-video-tagging-streaming)

Intermediate

9 min

### Visual Product Search for Ecommerce

Let shoppers search your catalog with images instead of keywords

2.3x increase for visual search users

Search-to-purchase conversion

[

ecommerce

](/solutions/ecommerce)

Who It's For

Ecommerce platforms, online marketplaces, fashion retailers, home goods stores, and any product catalog with 10K+ SKUs where visual discovery drives conversion

[View Details](/use-cases/visual-product-search-ecommerce)

Intermediate

8 min

### IAB Content Taxonomy 3.1 classification API for video, images and audio

Send video, images or podcast audio and get IAB Content Taxonomy 3.1 tier paths with a confidence score per category and timestamps per video scene.

Official IAB Content Taxonomy 3.1 IDs, checked by a unit test

Taxonomy

[

advertising

](/solutions/advertising)

Who It's For

Engineers at SSPs, DSPs, publishers, CTV platforms and podcast networks who need IAB Content Taxonomy 3.1 IDs on video, image and audio inventory, and who want to call an API and check the output themselves.

[View Details](/use-cases/iab-taxonomy-classification)

Intermediate

10 min

### Brand Safety Verification

AI-powered brand safety scoring for ad placements and content partnerships

Scored per scene

Video and CTV

[

advertising

](/solutions/advertising)

Who It's For

Brand safety teams at agencies, DSPs, SSPs, ad networks, and brand marketers who need to verify that ad placements and content partnerships meet safety standards before spend is allocated

[View Details](/use-cases/brand-safety-verification)

Advanced

9 min

### AI Compliance Document Review

Automate regulatory document review with multimodal AI understanding

10x faster

Review cycle time

[

legal

](/solutions/legal)[

finance

](/solutions/finance)

Who It's For

Compliance teams, regulatory affairs departments, and legal operations groups reviewing 1,000+ regulatory documents per quarter across banking, insurance, pharma, and financial services

[View Details](/use-cases/ai-compliance-document-review)

Advanced

12 min

### Clinical NLP at Scale

Extract structured intelligence from clinical notes, pathology reports, and medical records

94% F1 on medical NER benchmarks

Entity extraction accuracy

[

healthcare

](/solutions/healthcare)

Who It's For

Healthcare IT teams, clinical informatics departments, and health systems processing thousands of clinical documents daily

[View Details](/use-cases/clinical-nlp)

Intermediate

6 min

### Brand Logo Detection in Video

Scan video assets for unauthorized brand logos and trademarks

Detect logos across 3K+ brands

Brand coverage

[

ip safety

](/solutions/ip-safety)

Who It's For

Brand safety teams, ad agencies, and content distributors managing video libraries with potential trademark exposure

[View Details](/use-cases/brand-logo-video-detection)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

Learn more





](/extractors/multimodal)[

Recipe

### Brand Safety & Ad Verification Pipeline

Brand safety pipeline for ad networks. Scores video and image creatives against the GARM brand safety floor and suitability categories, which vendors still use after GARM wound down in 2024, before an ad is served.

Learn more





](/recipes/brand-safety-pipeline)[

Recipe

### Video Content Analytics Pipeline

Analyze video content at scale to extract insights: scene composition, speaker time, topic distribution, and sentiment across your video library.

Learn more





](/recipes/video-analytics-pipeline)[

Recipe

### Automated Video Tagging

Automatically generate descriptive tags for video content using scene analysis, object detection, and taxonomy classification. Each video receives structured labels for scenes, objects, actions, and custom business categories without manual annotation.

Learn more





](/recipes/automated-video-tagging)[

Recipe

### Video Scene Search

Find specific scenes within videos using natural language descriptions. The pipeline detects scene boundaries, generates embeddings for each scene, and enables precise timestamp-level search across an entire video library. Query for visual content, actions, or spoken dialogue.

Learn more





](/recipes/video-scene-search)[

Recipe

### Semantic Join

Bridge extracted content features with business reference data. Join video clips to product catalogs, detected faces to employee directories, or documents to compliance frameworks-all via embedding similarity.

Learn more





](/recipes/semantic-join)