class_docstr: Abstract Labeling Model
class_docstr_tok: ["Abstract","Labeling","Model"]
docstr: Gets entities from sequence.
  
  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`
      join_chunk: str or False,
      predict_kwargs: arguments passed to :meth:`tf.keras.Model.predict`
  
  Returns:
      list: list of entity.
docstr_tok: ["Gets","entities","from","sequence",".","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","`","join_chunk",":","str","or","False",",","predict_kwargs",":","arguments","passed","to",":","meth",":","`","tf.keras.Model.predict","`","Returns",":","list",":","list","of","entity","."]
code: def predict_entities(
      self,
      x_data: TextSamplesVar,
      batch_size: int = 32,
      join_chunk: str = " ",
      truncating: bool = False,
      predict_kwargs: Dict = None,
  ) -> List[Dict]:
      """Gets entities from sequence.
  
      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`
          join_chunk: str or False,
          predict_kwargs: arguments passed to :meth:`tf.keras.Model.predict`
  
      Returns:
          list: list of entity.
      """
      if isinstance(x_data, tuple):
          text_seq = x_data[0]
      else:
          text_seq = x_data
      res = self.predict(
          x_data,
          batch_size=batch_size,
          truncating=truncating,
          predict_kwargs=predict_kwargs,
      )
      new_res = [get_entities(seq) for seq in res]
      final_res = []
      for index, seq in enumerate(new_res):
          seq_data = []
          for entity in seq:
              res_entities: List[str] = []
              for i, e in enumerate(
                  text_seq[index][entity[1] : entity[2] + 1]
              ):
                  # Handle bert tokenizer
                  if e.startswith("##") and len(res_entities) > 0:
                      res_entities[-1] += e.replace("##", "")
                  else:
                      res_entities.append(e)
              value: Union[str, List[str]]
              if join_chunk is False:
                  value = res_entities
              else:
                  value = join_chunk.join(res_entities)
  
              seq_data.append(
                  {
                      "entity": entity[0],
                      "start": entity[1],
                      "end": entity[2],
                      "value": value,
                  }
              )
  
          final_res.append(
              {"tokenized": x_data[index], "labels": seq_data}
          )
      return final_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 9 for calling the ABCLabelingModel obj's underlying member method code with example usage: obj.predict_entities(x_data, batch_size, join_chunk, truncating, predict_kwargs) and returns: final_res