derive_generation#
- scikitplot.corpus.derive_generation(documents, *, backend=None, schema_version=None)[source]#
Derive the generation identity for a set of documents.
- Parameters:
- documentsIterable[Any]
iterable of CorpusDocument
- backendstr or None, optional
Name of the built index backend.
- schema_versionstr or None, optional
Overrides the package’s current serialisation version, for tests and for loading a persisted index written by another build.
- Returns:
- IndexGeneration
- Raises:
- ValueError
If the documents span more than one embedding manifest. That condition is already refused at build time; deriving a single generation for incompatible vectors would silently paper over it.
- Parameters:
- Return type:
Notes
Developer.
embedding_manifest_idis taken from the documents rather than from an engine, so a persisted index can have its generation recomputed from what it contains – which is the whole point of moving off a counter.