crslab.config package

Submodules

class crslab.config.config.Config(config_file, gpu='-1', debug=False)[source]

Bases: object

Configurator module that load the defined parameters.

Load parameters and set log level.

Parameters
  • config_file (str) – path to the config file, which should be in yaml format. You can use default config provided in the Github repo, or write it by yourself.

  • debug (bool, optional) – whether to enable debug function during running. Defaults to False.

get(item, default=None)[source]

Get value of corrsponding item in config

Parameters
  • item (str) – key to query in config

  • default (optional) – default value for item if not found in config. Defaults to None.

Returns

value of corrsponding item in config

static load_yaml_configs(filename)[source]

This function reads yaml file to build config dictionary

Parameters

filename (str) – path to yaml config

Returns

config

Return type

dict

Module contents

Config module which loads parameters for the whole system.

crslab.config.SAVE_PATH

where system to save.

Type

str

crslab.config.DATASET_PATH

where dataset to save.

Type

str

crslab.config.MODEL_PATH

where model related data to save.

Type

str

crslab.config.PRETRAIN_PATH

where pretrained model to save.

Type

str

crslab.config.EMBEDDING_PATH

where pretrained embedding to save, used for evaluate embedding related metrics.

Type

str