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
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
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. |