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","."]
docstr: return a list of sequence from a list of index arrays
docstr_tok: ["return","a","list","of","sequence","from","a","list","of","index","arrays"]
code: def get_sequence(self, batch):
      "return a list of sequence from a list of index arrays"
      ret = []
      filter_list = set([self.pad_id, self.sos_id, self.eos_id])
      for seq in batch:
          try:
              l = seq.index(self.eos_id)
          except:
              l = len(seq)
          ret.append(
              " ".join(
                  self.vocab[token]
                  for token in seq[:l]
                  if not token in filter_list
              )
          )
      return ret
  
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 9 for calling the TranslationDataset obj's underlying member method code with example usage: obj.get_sequence(batch) and returns: ret