class_docstr: Dataset class for translation task.
  By default, the source language shares the same vocabulary with the target language.
class_docstr_tok: ["Dataset","class","for","translation","task",".","By","default",",","the","source","language","shares","the","same","vocabulary","with","the","target","language","."]
code: def _make_vocab(self, path, thres=2):
      word_dict = {}
      for mode in ["train", "valid", "test"]:
          for line in self.src[mode] + self.tgt[mode]:
              for token in line.strip().split():
                  if token not in word_dict:
                      word_dict[token] = 0
                  else:
                      word_dict[token] += 1
  
      with open(path, "w") as f:
          for k, v in word_dict.items():
              if v > 2:
                  print(k, file=f)
  
file_path: dgl/examples/pytorch/transformer/dataset/__init__.py
imports: import os
  import random
  from .fields import *
  from .graph import *
  from .utils import prepare_dataset
label_desc: Use image node_id 3 for calling the TranslationDataset obj's underlying member method code with example usage: obj._make_vocab(path, thres) without return types