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.

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.

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.

scinr.newton.results.DeletionResult dataclass

Result of a delete_document() call — full Document + cascade + GC deletion.

Attributes:

Name Type Description
path str

The Document path that was targeted for deletion.

version int | None

The specific version requested, or None if all versions were targeted.

found bool

True if at least one matching Document existed before deletion. When False, all counters below are 0 and no delete or GC queries were executed.

versions_deleted list[int]

Sorted list of integer versions that matched and were deleted. Empty when found is False.

documents_deleted int

Number of :Document nodes deleted (the matched Document(s) plus any reached via IS_COMPOSED_OF*).

structure_nodes_deleted int

Number of :StructureNode nodes deleted.

info_units_deleted int

Number of :InfoUnit nodes deleted.

model_decisions_deleted int

Number of :ModelDecision nodes deleted.

proposed_models_deleted int

Number of :ProposedModel nodes deleted.

proposed_fields_deleted int

Number of :ProposedField nodes deleted.

extraction_results_deleted int

Number of :ExtractionResult nodes deleted.

gc_entity_model_instance_deleted int

Total :Entity/:ModelInstance nodes deleted across all garbage-collection iterations.

gc_entity_model_instance_passes int

Number of GC iterations actually run for the Entity/ModelInstance pass (capped at GC_MAX_PASSES).

gc_labeled_entity_deleted int

Total :LabeledEntity nodes deleted across all garbage-collection iterations.

gc_labeled_entity_passes int

Number of GC iterations actually run for the LabeledEntity pass (capped at GC_MAX_PASSES).

raw_files_deleted int

Number of raw_file_ids for which deletion was attempted against the storage backend (GridFS + metadata), for the raw_file_ids referenced by the deleted Document(s) and their descendants. Idempotent — includes ids that were already absent, since delete() returns None either way.

converted_pages_deleted int

Number of ConvertedPageRecord (converted Markdown pages) deleted from the storage layer for the same raw_file_ids.