removed tuples, 'msg' arguemnt and made use of f-strings : training.py
@@ -11,6 +11,7 @@ import numpy as np
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
+
def _create_model_folder(url):
""" Create the folder for the new model.
@@ -149,9 +150,10 @@ def _generate_training_dataset(training_data, temp_ds_path):
except IndexError:
# Should never occur since all the patterns have at least one key
# and at least one value
- logger.error('%s\n%s\n%s','Text is missing either the key or the value.',
- 'Skip this pattern.','The row in which the error has been detected : ')
- logger.error(msg=row)
+ logger.error('Text is missing either the key or the value. '
+ 'Skip this pattern.\n'
+ 'The row in which the error has been detected : ')
+ logger.error(row)
random.shuffle(to_write)
@@ -204,7 +206,7 @@ def _train_model(input_ds, valid_ds, learning_rate=0.1, epoch_model=50,
dim=word_vector_dim,
ws=context_window,
loss='ova')
- logger.info("%s : %s", "Evaluation of the model",str(model.test(valid_ds)))
+ logger.info(f'Evaluation of the model : {model.test(valid_ds)}')
return model
