derive_graph#
- scikitplot.corpus.derive_graph(documents, *, generation=None)[source]#
Build the G0 view from document fields.
- Parameters:
- documentsIterable[Any]
iterable of CorpusDocument
- generationstr or None, optional
Recorded on every edge for provenance.
- Returns:
- DerivedGraph
- Parameters:
- Return type:
DerivedGraph
Notes
These are derived, each from fields Corpus already stores:
contains/parent_offrom
parent_doc_id. Empty on today’s corpora – no producer sets that field yet (R13 / unknown U-11).same_sourcefrom
input_pathandsource_type.precedesfrom
chunk_index/paragraph_index/frame_indexwithin one parent.- the outline
from
metadata["heading_path"], whichStructureChunkerrecords on every chunk: oneheadingnode per source and heading path,contains/parent_ofbetween a heading and its sub-headings and between the innermost heading and the document, andsame_sourcefrom each top heading to its source. A document without a heading path adds nothing.
referencesis not derived:CorpusDocumenthas a singleurlfield – its own source URL, not outbound links – so true reference edges need G1 body-link extraction (finding F-R08-03).