Working with classifiers

The CLI makes it easy to work with Aluma classifiers. This article explains how to use the various classifier commands. If you aren't familiar with classifiers, you may find it helpful to read the Classification overview article.

Creating a classifier

Before you can create a classifier with the CLI you will need a set of sample documents, saved as a ZIP samples file. The Preparing sample documents article explains how to do this.

Once you have that, you can create a classifier with the following command, specifying the name of the classifier and the path to the samples file.

aluma create classifier classifier-name samples.zip

This command can take a while to complete, and will take longer the more samples you have.

Listing classifiers

To list all of the classifiers that you've created, run this command:

aluma list classifiers

Deleting a classifier

To delete a classifier you can run this command, specifying the name of the classifier to delete:

aluma delete classifier classifier-name

Using a classifier

To classify new files using a classifier, you can use the following command, specifying the file (or files) to classify and the name of the classifier to use:

aluma classify classifier-name *.pdf

See Selecting files to process for examples of how to use file patterns to select multiple files.

๐Ÿ“˜

Processing multiple files in one command is faster

If you are calling the CLI from a script or application, you will get substantially more throughput by using the classify command to process multiple files than by calling it multiple times with a single file. When it is processing multiple files the CLI uses all of your account's capacity & makes parallel requests to the service resulting in faster processing of the whole set of files.

The above command writes the classification results to the console in table format. You can specify CSV or JSON formats and also write results to a file, or files. For example, this command writes classification results to a single output file in CSV format:

aluma classify classifier-name *.pdf -f csv -o results.csv