class_docstr: A Keras implementation of BiLSTM-CRF for sequence labeling.
  
  References
  --
  Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, Chris Dyer.
  "Neural Architectures for Named Entity Recognition". Proceedings of NAACL 2016.
  https://arxiv.org/abs/1603.01360
code: def build(self):
      # build word embedding
      word_ids = keras.layers.Input(
          batch_shape=(None, None), dtype="int32", name="word_input"
      )
      inputs = [word_ids]
      embedding_list = []
      if self._embeddings is None:
          word_embeddings = keras.layers.Embedding(
              input_dim=self._word_vocab_size,
              output_dim=self._word_embedding_dim,
              mask_zero=True,
              name="word_embedding",
          )(word_ids)
      else:
          word_embeddings = keras.layers.Embedding(
              input_dim=self._embeddings.shape[0],
              output_dim=self._embeddings.shape[1],
              mask_zero=True,
              weights=[self._embeddings],
              name="word_embedding",
          )(word_ids)
      embedding_list.append(word_embeddings)
  
      # build character based word embedding
      if self._use_char:
          char_ids = keras.layers.Input(
              batch_shape=(None, None, None),
              dtype="int32",
              name="char_input",
          )
          inputs.append(char_ids)
          char_embeddings = keras.layers.Embedding(
              input_dim=self._char_vocab_size,
              output_dim=self._char_embedding_dim,
              mask_zero=self._char_mask_zero,
              name="char_embedding",
          )(char_ids)
          char_embeddings = keras.layers.TimeDistributed(
              keras.layers.Bidirectional(
                  keras.layers.LSTM(self._char_lstm_size)
              )
          )(char_embeddings)
          embedding_list.append(char_embeddings)
  
      # add elmo embedding
      if self._use_elmo:
          elmo_embeddings = keras.layers.Input(
              shape=(None, 1024), dtype="float32"
          )
          inputs.append(elmo_embeddings)
          embedding_list.append(elmo_embeddings)
  
      # add transformer embedding
      if self._use_transformer_with_dim is not None:
          transformer_embeddings = keras.layers.Input(
              shape=(None, self._use_transformer_with_dim),
              dtype="float32",
          )
          inputs.append(transformer_embeddings)
          embedding_list.append(transformer_embeddings)
  
      # concatenate embeddings
      word_embeddings = (
          keras.layers.Concatenate()(embedding_list)
          if len(embedding_list) > 1
          else embedding_list[0]
      )
  
      # build model
      word_embeddings = keras.layers.Dropout(self._dropout)(
          word_embeddings
      )
      z = keras.layers.Bidirectional(
          keras.layers.LSTM(
              units=self._word_lstm_size, return_sequences=True
          )
      )(word_embeddings)
      z = keras.layers.Dense(self._fc_dim, activation="tanh")(z)
  
      if self._use_crf:
          from .layers import CRF
  
          crf = CRF(self._num_labels, sparse_target=False)
          loss = crf.loss_function
          pred = crf(z)
      else:
          loss = "categorical_crossentropy"
          pred = keras.layers.Dense(
              self._num_labels, activation="softmax"
          )(z)
  
      model = keras.Model(inputs=inputs, outputs=pred)
  
      return model, loss
  
file_path: ktrain/ktrain/text/ner/anago/models.py
imports: from ....None import utils
  from ....imports import *
label_desc: Use image node_id 2 for calling the BiLSTMCRF obj's underlying member method code with example usage: obj.build() and returns: model,  loss