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. <click.types.Path object at 0x7fb1daf3dcd0>
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
Arguments
- DOC
Required argument The path to the TEI XML document to classify. <click.types.Path object at 0x7fb1dac46910>
- OUTPUT
Optional argument The path to the output TEI XML file. <click.types.Path object at 0x7fb1dc960b10>
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. <click.types.Path object at 0x7fb1daa15a90>
- OUTPUT
Optional argument The path to the output TEI XML file. <click.types.Path object at 0x7fb1daa14650>
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. <click.types.Path object at 0x7fb1da9ff690>
- GROUND_TRUTH
Required argument The path to the input TEI XML document to use as the ground truth for evaluation. <click.types.Path object at 0x7fb1da9ffbd0>
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. <click.types.Path object at 0x7fb1daa14790>
- OUTPUT
Required argument The path to the output Excel file. <click.types.Path object at 0x7fb1daa14cd0>
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. <click.types.Path object at 0x7fb1da9fe490>
- OUTPUT
Optional argument The path to the output TEI XML file. <click.types.Path object at 0x7fb1da9fe090>
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. <click.types.Path object at 0x7fb1dabe70d0>
- OUTPUT
Required argument The path to the output HTML file. <click.types.Path object at 0x7fb1da9fda90>
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. <click.types.Path object at 0x7fb1daa15d90>
- SPREADSHEET
Required argument The path to the Excel file to import. <click.types.Path object at 0x7fb1daa15c50>
- OUTPUT
Optional argument The path to the output TEI XML file. <click.types.Path object at 0x7fb1daa16350>
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. <click.types.Path object at 0x7fb1daa167d0>
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. <click.types.Path object at 0x7fb1da9fe9d0>
- OUTPUT
Required argument The path to the output TEI XML file. <click.types.Path object at 0x7fb1da9ffd10>