def __init__(
        self, train, dev, test, vocab_size, lowercase=True, vocab=None, seed=0
    ):
        """Initialize params.

        Each of train/dev/test is a tab-separate file of the form
        premise \t hypothesis \t label.

        Args:
            train(torch.Tensor): Training dataset.
            dev(torch.Tensor): Validation dataset.
            test(torch.Tensor): Testing dataset.
            vocab_size(int): The size of the vocabulary.
            lowercase(bool): If lowercase the dataset.
            vocab(Union[bytes,str): The list of the vocabulary.
        """
        self.seed = seed
        self.train = train
        self.dev = dev
        self.test = test
        self.vocab_size = vocab_size
        self.lowercase = lowercase
        self.vocab = vocab
        self.train_lines = [
            line.strip().lower().split("\t")
            for line in open(self.train, encoding="utf-8")
        ]
        self.dev_lines = [
            line.strip().lower().split("\t")
            for line in open(self.dev, encoding="utf-8")
        ]
        self.test_lines = [
            line.strip().lower().split("\t")
            for line in open(self.test, encoding="utf-8")
        ]

        if self.vocab is not None:
            # binary mode doesn't take an encoding argument
            self.vocab = pickle.load(open(self.vocab, "rb"))
            self.word2id = self.vocab["word2id"]
            self.id2word = self.vocab["id2word"]
            self.vocab_size = len(self.word2id)
        else:
            self.word2id, self.id2word = self.construct_vocab(
                [x[0] for x in self.train_lines]
                + [x[1] for x in self.train_lines],
                self.vocab_size,
                lowercase=self.lowercase,
            )

        # Label text to class mapping.
        self.text2label = {"entailment": 0, "neutral": 1, "contradiction": 2}

        self.shuffle_dataset()
Initialize params.

        Each of train/dev/test is a tab-separate file of the form
        premise 	 hypothesis 	 label.

        Args:
            train(torch.Tensor): Training dataset.
            dev(torch.Tensor): Validation dataset.
            test(torch.Tensor): Testing dataset.
            vocab_size(int): The size of the vocabulary.
            lowercase(bool): If lowercase the dataset.
            vocab(Union[bytes,str): The list of the vocabulary.
        
utils_nlp/models/gensen/utils.py