class_docstr: Class for evaluating the performance of mapping W
class_docstr_tok: ["Class","for","evaluating","the","performance","of","mapping","W"]
docstr: This method read through the test file and gets their embedding indices
docstr_tok: ["This","method","read","through","the","test","file","and","gets","their","embedding","indices"]
code: def load_eval_dataset(self):
      """
      This method read through the test file and gets their embedding indices
      """
      dict_path = get_eval_data(
          self.eval_path, self.src_lang, self.tgt_lang
      )
  
      pairs = []
      not_found_all = 0
      not_found_L1 = 0
      not_found_L2 = 0
  
      # Open the file and check if src and tgt word exists in the vocab
      with open(dict_path, "r") as f:
          for _, line in enumerate(f):
              word1, word2 = line.rstrip().split()
              if word1 in self.src_dico and word2 in self.tgt_dico:
                  pairs.append(
                      (
                          self.src_dico.index(word1),
                          self.tgt_dico.index(word2),
                      )
                  )
              else:
                  not_found_all += 1
                  not_found_L1 += int(word1 not in self.src_dico)
                  not_found_L2 += int(word2 not in self.tgt_dico)
      print(
          "Found %i pairs of words in the dictionary (%i unique). "
          " %i other pairs contained at least one unknown word "
          " (%i in src_lang, %i in tgt_lang)"
          % (
              len(pairs),
              len(set([x for x, _ in pairs])),
              not_found_all,
              not_found_L1,
              not_found_L2,
          )
      )
      src_ind = [pairs[x][0] for x in range(len(pairs))]
      tgt_ind = [pairs[x][1] for x in range(len(pairs))]
      self.src_ind = np.asarray(src_ind)
      self.tgt_ind = np.asarray(tgt_ind)
  
file_path: nlp-architect/examples/crosslingembs/evaluate.py
imports: from __future__ import print_function, division
  import numpy
  import tensorflow
  from nlp_architect.data.fasttext_emb import get_eval_data
label_desc: Use image node_id 2 for calling the Evaluate obj's underlying member method code with example usage: obj.load_eval_dataset() without return types