Skip to main content
Working examples are available in the /examples directory of the repository.

Basic Usage

Working with DataFrames

Using Predefined Taxonomy

Skip taxonomy discovery and use your own categories:
Use predefined taxonomy when you already know your categories, want consistent labeling across runs, or need to match an existing classification system.

Processing Documents Directly

Use Doc objects for programmatic input:

Async API

For async applications:

Analyzing Results

Working with Metadata

Access comprehensive run statistics:

Checking Classifier Performance

When the classifier is used (sample_size < total docs):

CLI Quick Examples

Handling Imbalanced Data

When your data has class imbalance (some categories much more common than others), you may need to adjust parameters to ensure good classifier performance.
See the Handling Class Imbalance guide for a complete explanation of these metrics and how to tune them.

Production Workflow: Train Once, Classify Many

For cost-effective production use, train a classifier once and reuse it for new documents without LLM costs.

Step 1: Initial Run and Export

Step 2: Human Review (Optional)

Review labeled_documents.csv and correct mislabeled documents, focusing on “Other” categories and edge cases.

Step 3: Retrain from Corrected Data

Step 4: Production Classification

See the Classifier Export & Training guide for complete documentation on saving, loading, and training classifiers.

Running Examples