Skip to content

CLI

actantial.cli.main()

Entry point for the actantial CLI command.

Parses command-line arguments, initialises the appropriate backend, and delegates to run_extract.

Parameters:

Name Type Description Default
--data_file

CSV file with id and text columns.

required
--output_dir

Directory where results and logs will be saved.

required
--backend

LLM backend to use for inference. One of anthropic, openai, huggingface.

required
--model

Model name or identifier understood by the chosen backend.

required
--repository

HuggingFace repository name. Required when using the huggingface backend.

required
--quantise

Run the model in 4-bit quantised mode. Only valid for the huggingface backend on a CUDA GPU.

required
--template

Prompt template name. Must exist in templates_dir/{model}/.

required
--actor_labels_path

Path to a YAML file with predefined actor labels for closed-set annotation.

required
--object_labels_path

Path to a YAML file with predefined object labels for closed-set annotation.

required
--resume_timestamp

Timestamp of a previous run to resume, in YYYYMMDD_HHMMSS format. The model and template must match the original run.

required
--templates_dir

Directory containing prompt templates. Defaults to the bundled templates.

required
--backend_params_path

Path to a YAML file of keyword arguments passed to the backend constructor (e.g. temperature, top_p).

required

actantial.cli.init_templates()

Entry point for the actantial-init-templates CLI command.

Copies the bundled prompt templates to a local directory so they can be inspected and customised. The destination must not already exist.

Parameters:

Name Type Description Default
--dest

Parent directory in which a templates/ folder will be created. Defaults to the current directory.

required

Examples

# OpenAI API
actantial \
    --data_file "data.csv" \
    --output_dir "output" \
    --backend openai \
    --model "gpt-4o-mini" \
    --templates_dir "templates" \
    --template "my_template"

# HuggingFace (GPU, 4-bit quantised)
actantial \
    --data_file "data.csv" \
    --output_dir "output" \
    --backend huggingface \
    --repository "deepseek-ai" \
    --model "DeepSeek-R1-Distill-Qwen-32B" \
    --templates_dir "templates" \
    --template "my_template" \
    --quantise

# With predefined label sets
actantial \
    --data_file "data.csv" \
    --output_dir "output" \
    --backend anthropic \
    --model "claude-haiku-4-5" \
    --templates_dir "templates" \
    --template "my_template_closed" \
    --actor_labels_path "labels/actors.yaml" \
    --object_labels_path "labels/objects.yaml"

Resuming an interrupted run:

actantial \
    --data_file "data.csv" \
    --output_dir "output" \
    --backend openai \
    --model "gpt-4o-mini" \
    --templates_dir "templates" \
    --template "my_template" \
    --resume_timestamp "20260101_121500"