code: def _load_embedding_txt(file_path, vocab, unknown_token):
      if vocab is not None:
          result = np.zeros(len(vocab), dtype=bool)
      else:
          result = []
      with open(file_path, "r", encoding="utf-8") as f:
          line = f.readline().strip()
          parts = line.split()
          start_idx = 0
          if len(parts) == 2:
              dim = int(parts[1])
              start_idx += 1
          else:
              dim = len(parts) - 1
              f.seek(0)
          if vocab is None:
              matrix = []
          else:
              matrix = np.random.randn(len(vocab), dim).astype(
                  "float32"
              )
          for idx, line in enumerate(f, start_idx):
              try:
                  parts = line.strip().split()
                  word = "".join(parts[:-dim])
                  nums = parts[-dim:]
                  if vocab is None:
                      result.append(word)
                      matrix.append(
                          np.fromstring(
                              " ".join(nums),
                              sep=" ",
                              dtype="float32",
                              count=dim,
                          )
                      )
                  else:
                      if (
                          word == unknown_token
                          and vocab.unk_token is not None
                      ):
                          word = vocab.unk_token
                      if word in vocab:
                          index = vocab[word]
                          matrix[index] = np.fromstring(
                              " ".join(nums),
                              sep=" ",
                              dtype="float32",
                              count=dim,
                          )
                          result[index] = True
              except Exception as e:
                  logging.error(
                      "Error occurred at the {} line.".format(idx)
                  )
                  raise e
      if vocab is None:
          result = Vocab(result, unk_token=unknown_token)
          matrix = _append_unk_vecs(np.array(matrix), len(result))
      return matrix, result
  
file_path: gluon-nlp/src/gluonnlp/embedding/embed_loader.py
imports: import io
  import logging
  import os
  import warnings
  import fasttext
  import numpy
  from mxnet.gluon.utils import download, check_sha1, _get_repo_file_url
  from .None import _constants
  from ..base import get_home_dir
  from ..data import Vocab
label_desc: Use image node_id 3 for calling a global function with example usage: _load_embedding_txt(file_path, vocab, unknown_token) and returns: matrix,  result