class_docstr: An LSTM architecture for named entity recognition.
  Uses a character embedding layer followed by an LSTM to generate vector 
  representation from characters for each token.
  Then the character vector is concatenated with token embedding vector, 
  which is input to another LSTM  followed by a CRF layer.
docstr_tok: []
code: def load_pretrained_token_embeddings(
      self, sess, dataset, parameters, token_to_vector=None
  ):
      """ """
      if parameters["token_pretrained_embedding_filepath"] == "":
          return
  
      # Load embeddings
      start_time = time.time()
      print("Load token embeddings... ", end="", flush=True)
  
      if token_to_vector == None:
          token_to_vector = utils_nlp.load_pretrained_token_embeddings(
              parameters
          )
  
      initial_weights = sess.run(
          self.token_embedding_weights.read_value()
      )
      number_of_loaded_word_vectors = 0
      number_of_token_original_case_found = 0
      number_of_token_lowercase_found = 0
      number_of_token_digits_replaced_with_zeros_found = 0
      number_of_token_lowercase_and_digits_replaced_with_zeros_found = 0
  
      for token in dataset.token_to_index.keys():
          if token in token_to_vector.keys():
              initial_weights[
                  dataset.token_to_index[token]
              ] = token_to_vector[token]
              number_of_token_original_case_found += 1
          elif (
              parameters["check_for_lowercase"]
              and token.lower() in token_to_vector.keys()
          ):
              initial_weights[
                  dataset.token_to_index[token]
              ] = token_to_vector[token.lower()]
              number_of_token_lowercase_found += 1
          elif (
              parameters["check_for_digits_replaced_with_zeros"]
              and re.sub(r"\d", "0", token) in token_to_vector.keys()
          ):
              initial_weights[
                  dataset.token_to_index[token]
              ] = token_to_vector[re.sub(r"\d", "0", token)]
              number_of_token_digits_replaced_with_zeros_found += 1
          elif (
              parameters["check_for_lowercase"]
              and parameters["check_for_digits_replaced_with_zeros"]
              and re.sub("\d", "0", token.lower())
              in token_to_vector.keys()
          ):
              initial_weights[
                  dataset.token_to_index[token]
              ] = token_to_vector[re.sub(r"\d", "0", token.lower())]
              number_of_token_lowercase_and_digits_replaced_with_zeros_found += (
                  1
              )
          else:
              continue
          number_of_loaded_word_vectors += 1
      elapsed_time = time.time() - start_time
  
      print("done ({0:.2f} seconds)".format(elapsed_time))
      print(
          "number_of_token_original_case_found: {0}".format(
              number_of_token_original_case_found
          )
      )
      print(
          "number_of_token_lowercase_found: {0}".format(
              number_of_token_lowercase_found
          )
      )
      print(
          "number_of_token_digits_replaced_with_zeros_found: {0}".format(
              number_of_token_digits_replaced_with_zeros_found
          )
      )
      print(
          "number_of_token_lowercase_and_digits_replaced_with_zeros_found: {0}".format(
              number_of_token_lowercase_and_digits_replaced_with_zeros_found
          )
      )
      print(
          "number_of_loaded_word_vectors: {0}".format(
              number_of_loaded_word_vectors
          )
      )
      print(
          "dataset.vocabulary_size: {0}".format(dataset.vocabulary_size)
      )
      sess.run(self.token_embedding_weights.assign(initial_weights))
  
file_path: NeuroNER/neuroner/entity_lstm.py
imports: import os
  import pickle
  import re
  import time
  import tensorflow
  from neuroner import utils
  from neuroner import utils_tf
  from neuroner import utils_nlp
label_desc: Use image node_id 3 for calling the EntityLSTM obj's underlying member method code with example usage: obj.load_pretrained_token_embeddings(sess, dataset, parameters, token_to_vector) without return types