code: def entities_from_array(
      x_train,
      y_train,
      x_test=None,
      y_test=None,
      use_char=False,
      val_pct=0.1,
      verbose=1,
  ):
      """
      Load entities from arrays
      Args:
        x_train(list): list of list of entity tokens for training
                       Example: x_train = [['Hello', 'world'], ['Hello', 'Cher'], ['I', 'love', 'Chicago']]
        y_train(list): list of list of tokens representing entity labels
                       Example:  y_train = [['O', 'O'], ['O', 'B-PER'], ['O', 'O', 'B-LOC']]
        x_test(list): list of list of entity tokens for validation
                       Example: x_train = [['Hello', 'world'], ['Hello', 'Cher'], ['I', 'love', 'Chicago']]
        y_test(list): list of list of tokens representing entity labels
                       Example:  y_train = [['O', 'O'], ['O', 'B-PER'], ['O', 'O', 'B-LOC']]
       use_char(bool):    If True, data will be preprocessed to use character embeddings  in addition to word embeddings
       val_pct(float):  percentage of training to use for validation if no validation data is supplied
       verbose (boolean): verbosity
  
      """
      # TODO: converting to df to use entities_from_df - needs to be refactored
      train_df = pp.array_to_df(x_train, y_train)
      val_df = None
      if x_test is not None and y_test is not None:
          val_df = pp.array_to_df(x_test, y_test)
      if verbose:
          print("training data sample:")
          print(train_df.head())
          if val_df is not None:
              print("validation data sample:")
              print(val_df.head())
      return entities_from_df(
          train_df,
          val_df=val_df,
          val_pct=val_pct,
          use_char=use_char,
          verbose=verbose,
      )
  
file_path: ktrain/ktrain/text/ner/data.py
imports: from ...None import utils
  from ...imports import *
  from ..None import textutils
  from .None import preprocessor
  from .preprocessor import NERPreprocessor
label_desc: Use image node_id 5 for calling a global function with example usage: entities_from_array(x_train, y_train, x_test, y_test, use_char, val_pct, verbose) and returns: entities_from_df