src.core.bow package#

Submodules#

src.core.bow.bow module#

class src.core.bow.bow.BOW(config_dict)[source]#

Bases: object

A class to run BOW data preprocessing, training and inference

Parameters:

config_dict (dict) – Config Params Dictionary

fit(text_ls=None, y=None)[source]#

Fits BOW algo on preprocessed text

Parameters:
  • text_ls (list, optional) – List of preprocessec strings, defaults to None

  • y (list, optional) – Labels, defaults to None

fit_transform(text_ls=None, y=None)[source]#

Fits and Transforms preprocessed text

Parameters:
  • text_ls (list, optional) – List of preprocessec strings, defaults to None

  • y (list, optional) – Labels, defaults to None

Returns:

Word vectors, Labels

Return type:

tuple (numpy.ndarray [num_samples, num_vocab], numpy.ndarray [num_samples, num_vocab])

preprocess()[source]#

Preprocesses text

run()[source]#

Runs BOW Fit, Transform and saves output

save_output(X, y)[source]#

Saves Training and Inference results

Parameters:
  • X (numpy.ndarray (num_samples, num_vocab)) – Word vectors

  • y (list, optional) – Labels, defaults to None

transform(text_ls=None, y=None)[source]#

Transforms preprocessed text

Parameters:
  • text_ls (list, optional) – List of preprocessec strings, defaults to None

  • y (list, optional) – Labels, defaults to None

Returns:

Word vectors, Labels

Return type:

tuple (numpy.ndarray [num_samples, num_vocab], numpy.ndarray [num_samples, num_vocab])

Module contents#