class_docstr: A Keras implementation of ELMo BiLSTM-CRF for sequence labeling.
class_docstr_tok: ["A","Keras","implementation","of","ELMo","BiLSTM-CRF","for","sequence","labeling","."]
code: def build(self):
      # build word embedding
      word_ids = Input(
          batch_shape=(None, None), dtype="int32", name="word_input"
      )
      if self._embeddings is None:
          word_embeddings = Embedding(
              input_dim=self._word_vocab_size,
              output_dim=self._word_embedding_dim,
              mask_zero=True,
              name="word_embedding",
          )(word_ids)
      else:
          word_embeddings = Embedding(
              input_dim=self._embeddings.shape[0],
              output_dim=self._embeddings.shape[1],
              mask_zero=True,
              weights=[self._embeddings],
              name="word_embedding",
          )(word_ids)
  
      # build character based word embedding
      char_ids = Input(
          batch_shape=(None, None, None),
          dtype="int32",
          name="char_input",
      )
      char_embeddings = Embedding(
          input_dim=self._char_vocab_size,
          output_dim=self._char_embedding_dim,
          mask_zero=True,
          name="char_embedding",
      )(char_ids)
      char_embeddings = TimeDistributed(
          Bidirectional(LSTM(self._char_lstm_size))
      )(char_embeddings)
  
      elmo_embeddings = Input(shape=(None, 1024), dtype="float32")
  
      word_embeddings = Concatenate()(
          [word_embeddings, char_embeddings, elmo_embeddings]
      )
  
      word_embeddings = Dropout(self._dropout)(word_embeddings)
      z = Bidirectional(
          LSTM(units=self._word_lstm_size, return_sequences=True)
      )(word_embeddings)
      z = Dense(self._fc_dim, activation="tanh")(z)
  
      crf = CRF(self._num_labels, sparse_target=False)
      loss = crf.loss_function
      pred = crf(z)
  
      model = Model(
          inputs=[word_ids, char_ids, elmo_embeddings], outputs=pred
      )
  
      return model, loss
  
file_path: anago/anago/models.py
imports: import json
  from keras.layers import Dense, LSTM, Bidirectional, Embedding, Input, Dropout, TimeDistributed
  from keras.layers.merge import Concatenate
  from keras.models import Model, model_from_json
  from anago.layers import CRF
label_desc: Use image node_id 2 for calling the ELModel obj's underlying member method code with example usage: obj.build() and returns: model,  loss