base
Base benchmark runner interface.
Classes
class
BaseBenchmarkRunner
(ABC, )Abstract base class for benchmark runners.
Abstract base class for benchmark runners.
Provides common functionality for running benchmarks with multiple
runs and statistical analysis.
Attributes
| Name | Type | Description |
|---|---|---|
| config | — | — |
Methods
__init__(self, config: BenchmarkConfig)Initialize benchmark runner.
Parameters
config: BenchmarkConfig
log(self, message: str) → NoneLog a message.
Parameters
message: str
name(self) → strGet the name of this benchmark type.
run(self, kwargs = {}) → TExecute the benchmark.
Parameters
kwargs= {}
Functions
function
get_corpus_name(source: str | Path) → strExtract corpus name from path.
Extract corpus name from path.
Args:
source: Path to corpus
Returns:
Corpus name string
Parameters
source: str | Path
function
get_corpus_stats(api: Any) → dictGet statistics about a loaded corpus.
Get statistics about a loaded corpus.
Args:
api: Text-Fabric or Context-Fabric API object
Returns:
Dictionary with corpus statistics
Parameters
api: Any
function
load_cf_api(source: str | Path) → AnyLoad Context-Fabric API for a corpus.
Load Context-Fabric API for a corpus.
Embedding structures are preloaded automatically by default.
Set CF_EMBEDDING_CACHE=off environment variable to disable.
Args:
source: Path to TF source files
Returns:
Context-Fabric API object
Parameters
source: str | Path
function
load_tf_api(source: str | Path) → AnyLoad Text-Fabric API for a corpus.
Load Text-Fabric API for a corpus.
Args:
source: Path to TF source files
Returns:
Text-Fabric API object
Parameters
source: str | Path