Skip to content

Corpus Manipulation Commands

Bell Eapen edited this page Jan 29, 2026 · 1 revision

Corpus Manipulation Commands

The crispt tool allows fine-grained control over the "Corpus" object—the central data structure in CRISP-T. You can use it to inspect, debug, and manually edit your data.

General Syntax:

crispt --inp <corpus_path> [action] --out <output_path>

Inspecting the Corpus

Print Structure

View a readable summary of your corpus.

crispt --inp ./corpus --print "documents 10"
  • Formats:
    • --print documents: Show document summaries.
    • --print metadata: Show corpus-level metadata.
    • --print "documents 5": First 5 docs.
    • --print "dataframe stats": Stats of the numeric data.

Inspect DataFrame

View details about the structured numeric data (CSV).

  • --df-cols: List all column names.
  • --df-row-count: Total number of rows.
  • --df-row <index>: View a specific row by its 0-based index.

Inspect Documents

  • --doc-ids: List all document IDs.
  • --doc-id <ID>: View full details (text + metadata) for a specific document.

Inspect Relationships

  • --relationships: List all defined links between data points.
  • --relationships-for-keyword <keyword>: Show links involving a specific word.

Export Metadata

Export the internal metadata of your corpus (e.g., from semantic search) as a DataFrame.

crispt --inp ./corpus --metadata-df --out ./exported
  • --metadata-keys "key1,key2": Specific keys to include.

Editing the Corpus

Create New Corpus

Start a fresh corpus without importing files.

crispt --id my_new_corpus --name "My Study" --out ./new_corpus

Add/Remove Documents

Manually add or remove text.

  • Add: crispt --doc "id|title|text_content"
    • Example: crispt --doc "101|Interview 1|The participant said..."
  • Remove: crispt --remove-doc <id>

Edit Metadata

Add custom metadata fields to the corpus object.

crispt --meta "project_phase=pilot"

Relational Editing

  • Add Link: crispt --add-rel "first|second|relation"
  • Clear All Links: crispt --clear-rel

(See Data Linking Commands for automated linking)

Clone this wiki locally