lir.config.lrsystem_architectures module

class lir.config.lrsystem_architectures.ParsedLRSystem(lrsystem: LRSystem, config: ContextAwareDict)[source]

Bases: LRSystem

Represent a given initialized LR system based on the provided configuration.

Parameters:
  • lrsystem (LRSystem) – Underlying LR system implementation.

  • config (ContextAwareDict) – Original LR system configuration.

apply(instances: InstanceData) LLRData[source]

Apply the fitted LR system.

Parameters:

instances (InstanceData) – Instances to score.

Returns:

Computed likelihood-ratio data.

Return type:

LLRData

fit(instances: InstanceData) Self[source]

Fit the LR system on instance data.

Parameters:

instances (InstanceData) – Training instances.

Returns:

This wrapper instance.

Return type:

Self

lir.config.lrsystem_architectures.augment_config(baseline_config: ContextAwareDict, hyperparameters: dict[str, HyperparameterOption]) ContextAwareDict[source]

Parse an augmented LR system.

The LR system is parsed from a base configuration and a set of parameter substitutions that override parts of the base configuration. Results are written to a subdirectory of output_dir that is named by its parameter substitutions and prefixed by dirname_prefix.

Parameters:
  • baseline_config (ContextAwareDict) – Base LR system configuration.

  • hyperparameters (dict[str, HyperparameterOption]) – Hyperparameter substitutions overriding parts of the base configuration.

Returns:

Augmented LR system configuration.

Return type:

ContextAwareDict

lir.config.lrsystem_architectures.parse_default_pipeline(config: ContextAwareDict) str[source]

Parse the intermediate output flag to determine the default pipeline method.

Parameters:

config (ContextAwareDict) – Configuration dictionary.

Returns:

Default method name ('logging_pipeline' or 'pipeline').

Return type:

str

lir.config.lrsystem_architectures.parse_lrsystem(config: ContextAwareDict, output_dir: Path) ParsedLRSystem[source]

Determine and initialise corresponding LR system from configuration values.

LR systems are provided under the architectures key.

Parameters:
  • config (ContextAwareDict) – LR system configuration.

  • output_dir (Path) – Output directory for nested parser calls.

Returns:

Wrapper containing parsed LR system and source configuration.

Return type:

ParsedLRSystem