class_docstr: Abstract Labeling Model
class_docstr_tok: ["Abstract","Labeling","Model"]
docstr: Configures the model for training.
  call :meth:`tf.keras.Model.predict` to compile model with custom loss, optimizer and metrics
  
  Examples:
  
      >>> model = BiLSTM_Model()
      # Build model with corpus
      >>> model.build_model(train_x, train_y)
      # Compile model with custom loss, optimizer and metrics
      >>> model.compile(loss='categorical_crossentropy', optimizer='rsm', metrics = ['accuracy'])
  
  Args:
      loss: name of objective function, objective function or ``tf.keras.losses.Loss`` instance.
      optimizer: name of optimizer or optimizer instance.
      metrics (object): List of metrics to be evaluated by the model during training and testing.
      kwargs: additional params passed to :meth:`tf.keras.Model.predict``.
docstr_tok: ["Configures","the","model","for","training",".","call",":","meth",":","`","tf.keras.Model.predict","`","to","compile","model","with","custom","loss",",","optimizer","and","metrics","Examples",":",">",">",">","model","=","BiLSTM_Model","(",")","#","Build","model","with","corpus",">",">",">","model.build_model","(","train_x",",","train_y",")","#","Compile","model","with","custom","loss",",","optimizer","and","metrics",">",">",">","model.compile","(","loss='categorical_crossentropy","'",",","optimizer='rsm","'",",","metrics","=","[","'accuracy","'","]",")","Args",":","loss",":","name","of","objective","function",",","objective","function","or","``","tf.keras.losses.Loss","``","instance",".","optimizer",":","name","of","optimizer","or","optimizer","instance",".","metrics","(","object",")",":","List","of","metrics","to","be","evaluated","by","the","model","during","training","and","testing",".","kwargs",":","additional","params","passed","to",":","meth",":","`","tf.keras.Model.predict","``","."]
code: def compile_model(
      self,
      loss: Any = None,
      optimizer: Any = None,
      metrics: Any = None,
      **kwargs: Any,
  ) -> None:
      """
      Configures the model for training.
      call :meth:`tf.keras.Model.predict` to compile model with custom loss, optimizer and metrics
  
      Examples:
  
          >>> model = BiLSTM_Model()
          # Build model with corpus
          >>> model.build_model(train_x, train_y)
          # Compile model with custom loss, optimizer and metrics
          >>> model.compile(loss='categorical_crossentropy', optimizer='rsm', metrics = ['accuracy'])
  
      Args:
          loss: name of objective function, objective function or ``tf.keras.losses.Loss`` instance.
          optimizer: name of optimizer or optimizer instance.
          metrics (object): List of metrics to be evaluated by the model during training and testing.
          kwargs: additional params passed to :meth:`tf.keras.Model.predict``.
      """
      if loss is None:
          loss = "sparse_categorical_crossentropy"
      if optimizer is None:
          optimizer = "adam"
      if metrics is None:
          metrics = ["accuracy"]
  
      self.tf_model.compile(
          loss=loss, optimizer=optimizer, metrics=metrics, **kwargs
      )
  
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 5 for calling the ABCLabelingModel obj's underlying member method code with example usage: obj.compile_model(loss, optimizer, metrics) without return types