Skip to main content
Learn how to export trained classifiers, classify new documents without LLM costs, and train classifiers from your own labeled data.

Overview

Delve’s classifier workflow enables cost-effective production use:
  1. Export: Save a trained classifier after any Delve run
  2. Classify: Label new documents using only embeddings (no LLM)
  3. Retrain: Improve classifiers with corrected/curated data

Exporting a Classifier

After running Delve, save the classifier for later use:

What’s Saved

The .joblib bundle contains:
  • Trained RandomForest model
  • Category index mappings
  • Embedding model name (for consistency)
  • Full taxonomy with descriptions
  • Training metrics
A classifier is only available when sample_size < total documents. If all documents were labeled by the LLM (no classifier was trained), save_classifier() will raise an error.

Classifying New Documents

Load a saved classifier and classify documents with no LLM cost:

Cost Comparison

Accessing Results

API Options

Training from Labeled Data

Train a classifier directly from your labeled dataset:

When to Use This

  • You have manually labeled data
  • You’ve corrected Delve’s output
  • You want to combine multiple labeled datasets
  • You’re creating a production classifier from curated examples

With Explicit Taxonomy

Provide a taxonomy for consistent category descriptions:
If no taxonomy is provided, one is inferred from the unique labels in your data.

Checking Quality

API Options

Human-in-the-Loop Workflow

Combine Delve’s automation with human expertise:

Step 1: Initial Run

Step 2: Human Review

Review labeled_documents.csv and correct mislabeled documents. Focus on:
  • Low-confidence predictions
  • “Other” category documents
  • Edge cases between similar categories

Step 3: Retrain from Corrected Data

Step 4: Production Classification

Focus human review on low-confidence predictions and “Other” categories - these benefit most from correction.

Async API

Both methods have async versions for use in async applications:

Result Classes

ClassificationResult

Returned by Delve.classify():

TrainingResult

Returned by Delve.train_from_labeled():

Next Steps

Class Imbalance

Handle imbalanced data for better classifier performance

Configuration Guide

Tune parameters for your use case