def __init__(self, train_text, vocab, n=4):
        """
        construct n-grams
        :param train_text: total text for extract n grams,
        note that type is [n, 5], two-dim raw text list
        :param vocab: word_to_idx dict
        :param n: default 4
        """
        self.train_text = train_text
        self.vocab = vocab
        self.n = n

        construct n-grams
        :param train_text: total text for extract n grams,
        note that type is [n, 5], two-dim raw text list
        :param vocab: word_to_idx dict
        :param n: default 4
        
torchmm/datasets/preprocess/n_grams.py