Skip to main content
The data pipeline accepts six input formats. All files must be UTF-8 encoded. The simplest option is plain text with one sentence per line; structured formats (CSV, JSON, Parquet) support additional metadata like frequency and POS tags.

Supported Formats

Plain Text (.txt)

Simple UTF-8 text file with Myanmar content:

Requirements

  • Encoding: UTF-8 (required)
  • Line endings: LF or CRLF
  • Empty lines: Ignored
  • Comments: Not supported (lines starting with # are processed as normal text)

Best Practices

  1. One sentence per line (recommended)
  2. No HTML or markup
  3. Pre-normalize Unicode (NFC form)

CSV Format (.csv)

Structured data with optional metadata columns:

Column Specifications

Options

Configure column names via PipelineConfig:

JSON Format (.json)

Raw Array Format

The JSON file must be a raw array (top-level list), not wrapped in an object like {"entries": [...]}:
Items can also be plain strings:

JSON Lines (.jsonl)

One JSON object per line:

Options

Parquet Format (.parquet)

Apache Parquet is a columnar storage format, ideal for large datasets:

Column Detection

The ingester automatically detects the text column:
  1. Primary: Looks for a column named text
  2. Fallback: Uses the first string column in the schema

Advantages

  • Compression: Efficient storage for large corpora
  • Columnar: Fast reads for specific columns
  • Type-safe: Schema enforcement
  • Interoperability: Works with pandas, Spark, DuckDB

Example with pandas

Large Files

Automatic Sharding

The pipeline automatically shards large files for memory-efficient processing:

Manual Sharding

Split large corpora into shards:

Validation

Check Format Before Building

Note: There is no standalone validate subcommand. Use build --validate to validate input files.

Common Validation Errors

Encoding Conversion

Zawgyi to Unicode

For standalone Zawgyi-to-Unicode conversion:
Note: The data pipeline internally uses normalize_with_zawgyi_conversion(), which combines Zawgyi conversion with full text normalization (Unicode NFC, zero-width character removal, etc.). You do not need to pre-convert Zawgyi files before feeding them to the pipeline.

See Also