PipelineResult#
- class scikitplot.corpus.PipelineResult(input_path, output_path, format, documents, n_read, n_omitted, n_embedded, elapsed_seconds, stage_errors=())[source]#
Immutable summary of a single pipeline run.
- Parameters:
- input_pathstr
Input source identifier (file path, URL, or batch label).
- output_pathpathlib.Path or None
Path to the exported file, or
Nonewhen no export was requested (output_path=Nonein the pipeline call).- documentslist of CorpusDocument
All documents produced (after chunking, filtering, and optional embedding). Empty list if the source yielded no usable text.
- n_readint
Total raw chunks yielded by the reader before filtering.
- n_omittedint
Chunks dropped by the filter.
- n_embeddedint
Documents that received an embedding vector (0 when embedding is disabled).
- elapsed_secondsfloat
Wall-clock time for the entire run, in seconds.
- formatExportFormat or None
Format used for export, or
Nonewhen no export was done.
- Parameters:
Notes
n_read - n_omitted == len(documents)is an invariant maintained by the pipeline.Examples
>>> result.n_read 512 >>> result.elapsed_seconds 3.14 >>> len(result.documents) 487
- documents: tuple[CorpusDocument, ...][source]#
All documents produced by the pipeline run.
Stored as an immutable
tupleto enforce the frozen-dataclass contract. Uselist(result.documents)if a mutable copy is needed.len(result.documents) == result.n_documents.
- format: ExportFormat | None[source]#
- stage_errors: tuple[tuple[str, str], ...] = ()#
Stages that raised, as
(stage, reason)pairs. Empty on a clean run.Catching a stage failure so the run continues is deliberate: one bad normalizer should not abort a whole ingest. Being unable to tell afterwards is not. Without this the result of a clean run and of a run whose normalizer raised were identical, so a caller could not distinguish a corpus that was normalized from one where normalization failed and the text passed through untouched.
- property status: str#
"success"or"degraded".Notes
User. Check this before trusting the documents.
degradedmeans a stage raised and its work did not happen: the documents are real but incomplete, andstage_errorssays which stage and why.Developer. The words are the ones
corpus._retrievalalready uses rather than a second vocabulary invented here. A run that lost a stage is degraded, not empty – emptiness would claim everything requested ran and found nothing.