Skip to main content
The first step in the dictionary building pipeline converts raw corpus files (TXT, CSV, JSON, Parquet) into Arrow shards for efficient parallel processing downstream.

Overview

Ingestion stage overview showing input files flowing through CorpusIngester to Arrow shards

Supported Formats

Using the CorpusIngester

Basic Usage

The CorpusIngester reads corpus files and outputs Arrow shards for efficient processing:
For most use cases, use the Pipeline class which manages ingestion automatically:

Configuration Options

Configuration is handled through PipelineConfig and IngesterConfig:

Format-Specific Options

Plain Text

CSV/TSV

JSON

Parquet

Parquet files are read using PyArrow. The ingester automatically detects the text column:
  1. Looks for a column named text
  2. Falls back to the first string/large_string column

Streaming Large Files

The pipeline automatically handles large files by streaming and sharding:

Error Handling

The ingester validates input files and raises IngestionError for missing files:

Multiple Input Files

Multiple Paths

Glob Patterns (via CLI)

Performance Tips

  1. Use multiple workers for parallel ingestion
  2. Increase num_shards for large corpora
  3. Use SSD for faster I/O

Integration with Pipeline

See Also