Skip to content

Results API

scinr.newton.results.DocumentResult dataclass

Result of processing a single document through a pipeline stage.

Attributes:

Name Type Description
document_name str

The Neo4j document_name (or filename stem) of the processed document.

nodes_processed int

Number of nodes (or files) successfully processed within this document. For stages 0-2, this is 1 for success, 0 for failure. For stages 3-4, this is the number of StructureNodes processed.

nodes_failed int

Number of nodes (or files) that failed processing within this document.

errors list[str]

List of error messages for this document. Empty on full success.

Source code in src/scinr/newton/results.py
@dataclass
class DocumentResult:
    """Result of processing a single document through a pipeline stage.

    Attributes:
        document_name: The Neo4j document_name (or filename stem) of the processed document.
        nodes_processed: Number of nodes (or files) successfully processed within this document.
            For stages 0-2, this is 1 for success, 0 for failure.
            For stages 3-4, this is the number of StructureNodes processed.
        nodes_failed: Number of nodes (or files) that failed processing within this document.
        errors: List of error messages for this document. Empty on full success.
    """

    document_name: str
    nodes_processed: int
    nodes_failed: int
    errors: list[str] = field(default_factory=list)

scinr.newton.results.StageResult dataclass

Aggregated result of running a single pipeline stage.

Attributes:

Name Type Description
stage str

Stage identifier. One of: 'preprocess', 'extraction', 'ingestion', 'annotation', 'entity_extraction', 'tabular'.

success bool

True if total_failed == 0 and no global errors occurred.

documents list[DocumentResult]

Per-document results. One DocumentResult per file or document processed.

total_processed int

Sum of nodes_processed across all DocumentResult entries.

total_failed int

Sum of nodes_failed across all DocumentResult entries.

duration_seconds float

Wall-clock time in seconds for the entire stage.

errors list[str]

Global stage-level errors not attributable to a specific document.

Source code in src/scinr/newton/results.py
@dataclass
class StageResult:
    """Aggregated result of running a single pipeline stage.

    Attributes:
        stage: Stage identifier. One of: 'preprocess', 'extraction', 'ingestion',
            'annotation', 'entity_extraction', 'tabular'.
        success: True if total_failed == 0 and no global errors occurred.
        documents: Per-document results. One DocumentResult per file or document processed.
        total_processed: Sum of nodes_processed across all DocumentResult entries.
        total_failed: Sum of nodes_failed across all DocumentResult entries.
        duration_seconds: Wall-clock time in seconds for the entire stage.
        errors: Global stage-level errors not attributable to a specific document.
    """

    stage: str
    success: bool
    documents: list[DocumentResult]
    total_processed: int
    total_failed: int
    duration_seconds: float
    errors: list[str] = field(default_factory=list)

scinr.newton.results.PipelineResult dataclass

Aggregated result of a full run_pipeline() invocation.

Attributes:

Name Type Description
success bool

True only if every executed stage succeeded (no failures or errors).

total_duration_seconds float

Total wall-clock time for the entire pipeline run.

stages_executed list[str]

Ordered list of stage names that were actually run (skipped stages are not included).

preprocess StageResult | None

StageResult for Stage 0, or None if the stage was not executed.

extraction StageResult | None

StageResult for Stage 1, or None if the stage was not executed.

ingestion StageResult | None

StageResult for Stage 2, or None if the stage was not executed.

annotation StageResult | None

StageResult for Stage 3, or None if the stage was not executed.

entity_extraction StageResult | None

StageResult for Stage 4, or None if the stage was not executed.

tabular StageResult | None

StageResult for the tabular pipeline, or None if not executed.

Source code in src/scinr/newton/results.py
@dataclass
class PipelineResult:
    """Aggregated result of a full run_pipeline() invocation.

    Attributes:
        success: True only if every executed stage succeeded (no failures or errors).
        total_duration_seconds: Total wall-clock time for the entire pipeline run.
        stages_executed: Ordered list of stage names that were actually run (skipped stages
            are not included).
        preprocess: StageResult for Stage 0, or None if the stage was not executed.
        extraction: StageResult for Stage 1, or None if the stage was not executed.
        ingestion: StageResult for Stage 2, or None if the stage was not executed.
        annotation: StageResult for Stage 3, or None if the stage was not executed.
        entity_extraction: StageResult for Stage 4, or None if the stage was not executed.
        tabular: StageResult for the tabular pipeline, or None if not executed.
    """

    success: bool
    total_duration_seconds: float
    stages_executed: list[str]
    preprocess: StageResult | None = None
    extraction: StageResult | None = None
    ingestion: StageResult | None = None
    annotation: StageResult | None = None
    entity_extraction: StageResult | None = None
    tabular: StageResult | None = None