flow_inference.voyant_export.VoyantExporter

class flow_inference.voyant_export.VoyantExporter(text_column_prefix='inference_', document_id_column='filename', line_id_column='line_id', include_line_ids=False)[source]

Create Voyant-compatible ZIP archives from inference result DataFrames.

The exporter selects the latest inference column, groups recognized text by document ID, optionally prefixes lines with their line IDs, and writes one .txt file per document into a ZIP archive.

Parameters:
  • text_column_prefix (str)

  • document_id_column (str)

  • line_id_column (str)

  • include_line_ids (bool)

__init__(text_column_prefix='inference_', document_id_column='filename', line_id_column='line_id', include_line_ids=False)[source]

Initialize the Voyant exporter.

Parameters:
  • text_column_prefix (str) – Prefix used to identify inference text columns.

  • document_id_column (str) – Column containing the document or image identifier.

  • line_id_column (str) – Column containing the line identifier.

  • include_line_ids (bool) – Whether to prefix exported text lines with line IDs.

Methods

__init__([text_column_prefix, ...])

Initialize the Voyant exporter.

export(df, zip_path)

Create a Voyant-compatible ZIP archive from inference results.

from_huggingface(dataset_name, split, ...[, ...])

Download a Hugging Face dataset split and export it as a Voyant ZIP.