Documentation

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

NameTypeDescription
config

Methods

__init__(self, config: BenchmarkConfig)

Initialize benchmark runner.

Parameters
  • config: BenchmarkConfig
log(self, message: str) None

Log a message.

Parameters
  • message: str
name(self) str

Get the name of this benchmark type.

run(self, kwargs = {}) T

Execute the benchmark.

Parameters
  • kwargs= {}

Functions

function
get_corpus_name(source: str | Path) str

Extract 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) dict

Get 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) Any

Load 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) Any

Load 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