openfactcheck.lib.OpenFactCheckConfig#

class openfactcheck.lib.OpenFactCheckConfig(filename_or_path='config.json')[source][source]#

Class to load the OpenFactCheck configuration from a JSON or YAML file.

Parameters:

filename_or_path (str or path object) – The path to the configuration file.

retries#

Number of retries for the pipeline components.

Type:

int

pipeline#

Namedtuple containing the pipeline components.

Type:

namedtuple

solver_configs#

Dictionary containing the solver configurations.

Type:

dict

solver_paths#

Dictionary containing the paths to the solver models.

Type:

dict

output_path#

Path to the output directory.

Type:

str

secrets#

Namedtuple containing the API keys.

Type:

namedtuple

verbose#

The verbosity level for the logger.

Type:

str

solver_configuration(solver: str = None) dict:[source][source]#

Get the solver configuration for a specific solver or all solvers.

validate():

Validate the configuration file

Examples

For loading the default configuration file ‘config.json’: >>> config = OpenFactCheckConfig()

For loading the configuration file from a specific path or filename: >>> config = OpenFactCheckConfig(“config.json”)

For loading the configuration file and validating it: >>> config = OpenFactCheckConfig(“config.json”) >>> config.validate()

__init__(filename_or_path='config.json')[source][source]#
Parameters:

filename_or_path (str | Path)

Methods

__init__([filename_or_path])

solver_configuration([solver])

Get the solver configuration for a specific solver or all solvers.

validate()

Validate the configuration file.