def build_dataset(self):
        """TODO (huxu): move processor breakdown to MMDataset."""
        """fill-in `self.train_data`, `self.val_data` and `self.test_data`."""

        meta_processor_cls = getattr(
            processors, self.config.dataset.meta_processor)
        video_processor_cls = getattr(
            processors, self.config.dataset.video_processor)
        text_processor_cls = getattr(
            processors, self.config.dataset.text_processor)
        aligner_cls = getattr(
            processors, self.config.dataset.aligner)

        if self.config.dataset.train_path is not None:
            self.config.dataset.split = "train"
            # may be used by meta processor.
            # meta_processor controls different dataset.
            meta_processor = meta_processor_cls(self.config.dataset)
            video_processor = video_processor_cls(self.config.dataset)
            text_processor = text_processor_cls(self.config.dataset)
            aligner = aligner_cls(self.config.dataset)
            self.train_data = MMDataset(
                meta_processor, video_processor, text_processor, aligner
            )
            print("train_len", len(self.train_data))
            output = self.train_data[0]
            self.train_data.print_example(output)
        if self.config.dataset.val_path is not None:
            self.config.dataset.split = "valid"
            # may be used by meta processor.
            meta_processor = meta_processor_cls(self.config.dataset)
            video_processor = video_processor_cls(self.config.dataset)
            text_processor = text_processor_cls(self.config.dataset)
            aligner = aligner_cls(self.config.dataset)
            self.val_data = MMDataset(
                meta_processor, video_processor, text_processor, aligner
            )
            print("val_len", len(self.val_data))
            output = self.val_data[0]
            self.val_data.print_example(output)

        if self.config.dataset.split == "test":
            # the following is run via lauching fairseq-validate.
            meta_processor = meta_processor_cls(self.config.dataset)
            video_processor = video_processor_cls(self.config.dataset)
            text_processor = text_processor_cls(self.config.dataset)

            self.test_data = MMDataset(
                meta_processor, video_processor, text_processor, aligner
            )
            print("test_len", len(self.test_data))
            output = self.test_data[0]
            self.test_data.print_example(output)
TODO (huxu): move processor breakdown to MMDataset.
structured_prompting/fairseq-version/fairseq/examples/MMPT/mmpt/tasks/task.py