Command Line Interface Reference

rdgai

rdgai [OPTIONS] COMMAND [ARGS]...

Options

--install-completion

Install completion for the current shell.

--show-completion

Show completion for the current shell, to copy it or customize the installation.

classified-pairs

Print classified pairs in a document.

rdgai classified-pairs [OPTIONS] DOC

Arguments

DOC

Required argument The path to the TEI XML document with the classifications. <typer.models.TyperPath object at 0x7f7e72111890>

classify

Classifies relations in TEI documents.

rdgai classify [OPTIONS] DOC [OUTPUT]

Options

-i, --inplace

Overwrite the input file.

Default:

False

--verbose, --no-verbose

Print verbose output.

Default:

False

--api-key <api_key>

API key for the LLM.

Default:

--llm <llm>

ID of the language model to use.

Default:

gpt-4o

--temperature <temperature>

Temperature for sampling from the language model.

Default:

0.1

--prompt-only, --no-prompt-only

Only print the prompt and not classify.

Default:

False

--examples <examples>

Number of examples to include in the prompt.

Default:

10

--examples-doc <examples_doc>

The path to a TEI XML document to use for examples.

Arguments

DOC

Required argument The path to the TEI XML document to classify. <typer.models.TyperPath object at 0x7f7e72110290>

OUTPUT

Optional argument The path to the output TEI XML file. <typer.models.TyperPath object at 0x7f7e72110650>

clean

Cleans a TEI XML file for common errors.

rdgai clean [OPTIONS] DOC [OUTPUT]

Options

-i, --inplace

Overwrite the input file.

Default:

False

Arguments

DOC

Required argument The path to the TEI XML document to clean. <typer.models.TyperPath object at 0x7f7e72113d50>

OUTPUT

Optional argument The path to the output TEI XML file. <typer.models.TyperPath object at 0x7f7e72112a10>

evaluate

Evaluates the classifications in a predicted document against a ground truth document.

rdgai evaluate [OPTIONS] PREDICTED GROUND_TRUTH

Options

--confusion-matrix <confusion_matrix>

Path to write the confusion matrix plot as a CSV file.

--confusion-matrix-plot <confusion_matrix_plot>

Path to write the confusion matrix plot as an HTML file.

--report <report>

Path to write the report.

Arguments

PREDICTED

Required argument The path to the TEI XML document with predictions from Rdgai to evaluate. <typer.models.TyperPath object at 0x7f7e72111e10>

GROUND_TRUTH

Required argument The path to the input TEI XML document to use as the ground truth for evaluation. <typer.models.TyperPath object at 0x7f7e72112210>

export

Exports pairs of readings with classifications from a TEI document to an Excel spreadsheet.

rdgai export [OPTIONS] DOC OUTPUT

Arguments

DOC

Required argument The path to the TEI XML document to export. <typer.models.TyperPath object at 0x7f7e72112b50>

OUTPUT

Required argument The path to the output Excel file. <typer.models.TyperPath object at 0x7f7e72113110>

gui

Starts a Flask app to view and classify a TEI document.

rdgai gui [OPTIONS] DOC [OUTPUT]

Options

-i, --inplace

Overwrite the input file.

Default:

False

--debug, --no-debug
Default:

True

--use-reloader, --no-use-reloader
Default:

False

--all-apps, --no-all-apps

Whether or not to use all variation unit app elements. By default it shows only non-redundant pairs of readings.

Default:

False

Arguments

DOC

Required argument The path to the TEI XML document to classify. <typer.models.TyperPath object at 0x7f7e72111990>

OUTPUT

Optional argument The path to the output TEI XML file. <typer.models.TyperPath object at 0x7f7e72110910>

html

Renders the variation units of a TEI document as HTML.

rdgai html [OPTIONS] DOC OUTPUT

Options

--all-apps, --no-all-apps

Whether or not to use all variation unit app elements. By default it shows only non-redundant pairs of readings.

Default:

False

Arguments

DOC

Required argument The path to the TEI XML document to render as HTML. <typer.models.TyperPath object at 0x7f7e721118d0>

OUTPUT

Required argument The path to the output HTML file. <typer.models.TyperPath object at 0x7f7e721115d0>

import-classifications

Imports classifications from a spreadsheet into a TEI document.

rdgai import-classifications [OPTIONS] DOC SPREADSHEET [OUTPUT]

Options

-i, --inplace

Overwrite the input file.

Default:

False

--responsible <responsible>

The responsible party for the classifications. By default it is the name of the spreadsheet.

Default:

Arguments

DOC

Required argument The path to the base TEI XML document to use for importing the classifications from Excel. <typer.models.TyperPath object at 0x7f7e721129d0>

SPREADSHEET

Required argument The path to the Excel file to import. <typer.models.TyperPath object at 0x7f7e72100050>

OUTPUT

Optional argument The path to the output TEI XML file. <typer.models.TyperPath object at 0x7f7e72100690>

prompt-preamble

Prints the prompt preamble for a TEI document for a given number of examples.

rdgai prompt-preamble [OPTIONS] DOC

Options

--examples <examples>

Number of examples to include in the prompt.

Default:

10

Arguments

DOC

Required argument The path to the TEI XML document to classify. <typer.models.TyperPath object at 0x7f7e72100b50>

validate

Takes a ground truth document, chooses a proportion of classified pairs to validate against and outputs a report.

rdgai validate [OPTIONS] GROUND_TRUTH OUTPUT

Options

--proportion <proportion>

Proportion of classified pairs to use for validation.

Default:

0.5

--api-key <api_key>

API key for the LLM.

Default:

--llm <llm>

ID of the language model to use.

Default:

gpt-4o

--temperature <temperature>

Temperature for sampling from the language model.

Default:

0.1

--examples <examples>

Number of examples to include in the prompt.

Default:

10

--confusion-matrix <confusion_matrix>

Path to write the confusion matrix plot as a CSV file.

--confusion-matrix-plot <confusion_matrix_plot>

Path to write the confusion matrix plot as an HTML file.

--seed <seed>

Seed for random sampling of validation pairs.

Default:

42

--report <report>

Path to write the report.

Arguments

GROUND_TRUTH

Required argument The path to the input TEI XML document to use as the ground truth for evaluation. <typer.models.TyperPath object at 0x7f7e72112490>

OUTPUT

Required argument The path to the output TEI XML file. <typer.models.TyperPath object at 0x7f7e72112450>