예제 #1
0
    def after_download(self) -> bool:
        try:
            for data_type in self.samples_dict:

                samples = self.samples_dict[data_type]
                text_vocab_list = self.text_vocab_dict[data_type]

                train_file_path = os.path.join(
                    self.data_dir,
                    self.train_file.replace("txt", "") + data_type + ".txt")
                dev_file_path = os.path.join(
                    self.data_dir,
                    self.dev_file.replace("txt", "") + data_type + ".txt")
                test_file_path = os.path.join(
                    self.data_dir,
                    self.test_file.replace("txt", "") + data_type + ".txt")
                text_vocab_file = os.path.join(
                    self.data_dir,
                    self.text_vocab.replace("txt", "") + data_type + ".txt")

                mock_data(samples, train_file_path, dev_file_path,
                          test_file_path, text_vocab_file, text_vocab_list)

        except Exception as e:
            logging.warning(traceback.format_exc())
            return False
        return True
    def after_download(self) -> bool:
        try:
            train_file_path = os.path.join(self.data_dir, self.train_file)
            dev_file_path = os.path.join(self.data_dir, self.dev_file)
            test_file_path = os.path.join(self.data_dir, self.test_file)

            mock_data(self.samples, train_file_path, dev_file_path,
                      test_file_path)

        except Exception as e:
            logging.warning(traceback.format_exc())
            return False
        return True