code: def test_train_load_use_classifier_with_sampler(
      self,
      results_base_path,
      corpus,
      embeddings,
      example_sentence,
      train_test_sentence,
  ):
      flair.set_seed(123)
      label_dict = corpus.make_label_dictionary(
          label_type=self.train_label_type
      )
  
      model = self.model_cls(
          embeddings=embeddings,
          label_dictionary=label_dict,
          label_type=self.train_label_type,
      )
  
      trainer = ModelTrainer(model, corpus)
      trainer.train(
          results_base_path,
          max_epochs=2,
          shuffle=False,
          sampler=ImbalancedClassificationDatasetSampler,
      )
  
      model.predict(train_test_sentence)
  
      for label in train_test_sentence.get_labels(
          self.train_label_type
      ):
          assert label.value is not None
          assert 0.0 <= label.score <= 1.0
          assert isinstance(label.score, float)
  
      del trainer, model, corpus
  
      loaded_model = self.model_cls.load(
          results_base_path / "final-model.pt"
      )
  
      loaded_model.predict(example_sentence)
      loaded_model.predict([example_sentence, self.empty_sentence])
      loaded_model.predict([self.empty_sentence])
  
file_path: flair/tests/models/test_text_classifier.py
imports: import pytest
  import flair.datasets
  from flair.data import Sentence
  from flair.embeddings import DocumentRNNEmbeddings, FlairEmbeddings, WordEmbeddings
  from flair.models import TextClassifier
  from flair.samplers import ImbalancedClassificationDatasetSampler
  from flair.trainers import ModelTrainer
  from tests.model_test_utils import BaseModelTest
label_desc: Use image node_id 5 for calling the TestTextClassifier obj's underlying member method code with example usage: obj.test_train_load_use_classifier_with_sampler(results_base_path, corpus, embeddings, example_sentence, train_test_sentence) without return types