code: def test_train_callbacks(self):
      weights_file = os.path.join(SAVE_ROOT, "weights.h5")
      params_file = os.path.join(SAVE_ROOT, "params.json")
      preprocessor_file = os.path.join(SAVE_ROOT, "preprocessor.pickle")
  
      log_dir = os.path.join(os.path.dirname(__file__), "logs")
      file_name = (
          "_".join(["weights", "{epoch:02d}", "{f1:2.4f}"]) + ".h5"
      )
      callback = ModelCheckpoint(
          os.path.join(log_dir, file_name),
          monitor="f1",
          save_weights_only=True,
      )
      vocab = set()
      for words in np.r_[self.x_train, self.x_test, self.x_test]:
          for word in words:
              vocab.add(word)
      model = anago.Sequence(
          initial_vocab=vocab, embeddings=self.embeddings
      )
      model.fit(
          self.x_train,
          self.y_train,
          self.x_test,
          self.y_test,
          epochs=100,
          callbacks=[callback],
      )
      model.save(weights_file, params_file, preprocessor_file)
  
file_path: anago/tests/test_wrapper.py
imports: import os
  import unittest
  from pprint import pprint
  import numpy
  from keras.callbacks import ModelCheckpoint
  import anago
  from anago.utils import load_data_and_labels, load_glove
label_desc: Use image node_id 9 for calling the TestWrapper obj's underlying member method code with example usage: obj.test_train_callbacks() without return types