code: def test_text_classifier(tmp_path):
      train_x = test_utils.generate_text_data(
          num_instances=NUM_INSTANCES
      )
      train_y = np.array([0, 1] * ((NUM_INSTANCES + 1) // 2))[
          :NUM_INSTANCES
      ]
      test_x = train_x
      test_y = train_y
      clf = ak.TextClassifier(
          directory=tmp_path,
          max_trials=2,
          seed=test_utils.SEED,
          metrics=["accuracy"],
          objective="accuracy",
      )
      clf.fit(
          train_x,
          train_y,
          epochs=2,
          validation_data=(test_x, test_y),
          batch_size=BATCH_SIZE,
      )
      clf.export_model()
      assert clf.predict(test_x).shape == (len(test_x), 1)
      assert clf.tuner._get_best_trial_epochs() <= 2
  
file_path: autokeras/autokeras/integration_tests/task_api_test.py
imports: import numpy
  import pandas
  import tensorflow
  from tensorflow import keras
  import autokeras
  from autokeras import test_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_text_classifier(tmp_path) without return types