code: def load_gensim_embedding(vocab, min_freq=1):
      pretrained_vectors = api.load("word2vec-google-news-300")
  
      vectors = [
          np.zeros(pretrained_vectors.vectors.shape[1]),  # <ukn>
          np.zeros(pretrained_vectors.vectors.shape[1]),  # <pad>
      ]
      num_special_vectors = len(vectors)
      vectors += [
          pretrained_vectors.vectors[
              pretrained_vectors.vocab[vocab.itos[i]].index
          ]
          if vocab.itos[i] in pretrained_vectors.vocab
          else np.zeros(pretrained_vectors.vectors.shape[1])
          for i in range(num_special_vectors, len(vocab))
      ]
      for i in range(num_special_vectors, len(vocab)):
          if (
              vocab.itos[i] not in pretrained_vectors.vocab
              and vocab.freqs[vocab.itos[i]] >= min_freq
          ):
              vectors[i] = np.random.uniform(
                  -0.25, 0.25, pretrained_vectors.vectors.shape[1]
              )
  
      return torch.as_tensor(np.stack(vectors))
  
file_path: small-text/examples/examplecode/pytorch_multiclass_classification.py
imports: import torch
  import numpy
  from small_text import ActiveLearnerException, EmptyPoolException, ExpectedGradientLength, KimCNNFactory, PoolBasedActiveLearner, PoolExhaustedException, random_initialization_stratified
  from examplecode.data.example_data_multiclass import get_train_test, preprocess_data
  from examplecode.shared import evaluate
label_desc: Use image node_id 3 for calling a global function with example usage: load_gensim_embedding(vocab, min_freq) and returns: torch