code: def get_glove_matrix(glove_path, vocab, initial_embedding_np):
      ef = open(glove_path, "r", encoding="UTF-8")
      cnt = 0
      vec_array = initial_embedding_np
      old_avg = np.average(vec_array)
      old_std = np.std(vec_array)
      vec_array = vec_array.astype(np.float32)
      new_avg, new_std = 0, 0
  
      for line in ef.readlines():
          line = line.strip().split(" ")
          word, vec = line[0], line[1:]
          vec = np.array(vec, np.float32)
          if not vocab.has_word(word):
              continue
          word_idx = vocab.encode(word)
          if word_idx < vocab.vocab_size:
              cnt += 1
              vec_array[word_idx] = vec
              new_avg += np.average(vec)
              new_std += np.std(vec)
      new_avg /= cnt
      new_std /= cnt
      ef.close()
      logging.info(
          "%d known embedding. old mean: %f new mean %f, old std %f new std %f"
          % (cnt, old_avg, new_avg, old_std, new_std)
      )
      return vec_array
  
imports: import logging
  import json
  import numpy
  from collections import OrderedDict
  from .None import ontology
label_desc: Use image node_id 6 for calling a global function with example usage: get_glove_matrix(glove_path, vocab, initial_embedding_np) and returns: vec_array