class_docstr: Abstract Labeling Model
class_docstr_tok: ["Abstract","Labeling","Model"]
docstr: Generates output predictions for the input samples.
  
  Computation is done in batches.
  
  Args:
      x_data: The input data, as a Numpy array (or list of Numpy arrays if the model has multiple inputs).
      batch_size: Integer. If unspecified, it will default to 32.
      truncating: remove values from sequences larger than `model.embedding.sequence_length`
      predict_kwargs: arguments passed to :meth:`tf.keras.Model.predict`
  
  Returns:
      array(s) of predictions.
docstr_tok: ["Generates","output","predictions","for","the","input","samples",".","Computation","is","done","in","batches",".","Args",":","x_data",":","The","input","data",",","as","a","Numpy","array","(","or","list","of","Numpy","arrays","if","the","model","has","multiple","inputs",")",".","batch_size",":","Integer",".","If","unspecified",",","it","will","default","to","32.","truncating",":","remove","values","from","sequences","larger","than","`","model.embedding.sequence_length","`","predict_kwargs",":","arguments","passed","to",":","meth",":","`","tf.keras.Model.predict","`","Returns",":","array","(","s",")","of","predictions","."]
code: def predict(
      self,
      x_data: TextSamplesVar,
      *,
      batch_size: int = 32,
      truncating: bool = False,
      predict_kwargs: Dict = None,
  ) -> List[List[str]]:
      """
      Generates output predictions for the input samples.
  
      Computation is done in batches.
  
      Args:
          x_data: The input data, as a Numpy array (or list of Numpy arrays if the model has multiple inputs).
          batch_size: Integer. If unspecified, it will default to 32.
          truncating: remove values from sequences larger than `model.embedding.sequence_length`
          predict_kwargs: arguments passed to :meth:`tf.keras.Model.predict`
  
      Returns:
          array(s) of predictions.
      """
      if predict_kwargs is None:
          predict_kwargs = {}
      with kashgari.utils.custom_object_scope():
          if truncating:
              seq_length = self.sequence_length
          else:
              seq_length = None
  
          tensor = self.text_processor.transform(
              x_data,
              segment=self.embedding.segment,
              seq_length=seq_length,
              max_position=self.embedding.max_position,
          )
          logger.debug(
              "predict seq_length: {}, input: {}".format(
                  seq_length, np.array(tensor).shape
              )
          )
          pred = self.tf_model.predict(
              tensor, batch_size=batch_size, verbose=1, **predict_kwargs
          )
          pred = pred.argmax(-1)
  
          lengths = [len(sen) for sen in x_data]
  
          res: List[List[str]] = self.label_processor.inverse_transform(
              pred, lengths=lengths  # type: ignore
          )
          logger.debug(
              "predict output: {}".format(np.array(pred).shape)
          )
          logger.debug("predict output argmax: {}".format(pred))
      return res
  
imports: from abc import ABC
  from typing import List, Dict, Any, Union, Optional
  import numpy
  import tensorflow
  import kashgari
  from kashgari.embeddings import ABCEmbedding, BareEmbedding
  from kashgari.generators import CorpusGenerator, BatchDataSet
  from kashgari.layers import KConditionalRandomField
  from kashgari.logger import logger
  from kashgari.metrics.sequence_labeling import get_entities
  from kashgari.metrics.sequence_labeling import sequence_labeling_report
  from kashgari.processors import SequenceProcessor
  from kashgari.tasks.abs_task_model import ABCTaskModel
  from kashgari.types import TextSamplesVar
label_desc: Use image node_id 8 for calling the ABCLabelingModel obj's underlying member method code with example usage: obj.predict(x_data) and returns: res