How to use the paddlehub.common.dir.DATA_HOME function in paddlehub

To help you get started, we’ve selected a few paddlehub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PaddlePaddle / PaddleHub / paddlehub / dataset / chnsenticorp.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "chnsenticorp")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()
github PaddlePaddle / PaddleHub / paddlehub / dataset / tnews.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "tnews")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()
github PaddlePaddle / PaddleHub / paddlehub / dataset / lcqmc.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "lcqmc")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()
github PaddlePaddle / PaddleHub / paddlehub / dataset / lcqmc.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "lcqmc")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()
github PaddlePaddle / PaddleHub / paddlehub / dataset / cmrc2018.py View on Github external
def __init__(self):
        dataset_dir = os.path.join(DATA_HOME, "cmrc2018")
        base_path = self._download_dataset(dataset_dir, url=_DATA_URL)
        super(CMRC2018, self).__init__(
            base_path=base_path,
            train_file="cmrc2018_train.json",
            dev_file="cmrc2018_dev.json",
            test_file=None,
            label_file=None,
            label_list=None,
        )
github PaddlePaddle / PaddleHub / paddlehub / dataset / nlpcc_dbqa.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "nlpcc-dbqa")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()
github PaddlePaddle / PaddleHub / paddlehub / dataset / thucnews.py View on Github external
def __init__(self):
        dataset_dir = os.path.join(DATA_HOME, "thucnews")
        base_path = self._download_dataset(dataset_dir, url=_DATA_URL)
        super(THUCNEWS, self).__init__(
            base_path=base_path,
            train_file="train.txt",
            dev_file="dev.txt",
            test_file="test.txt",
            label_file=None,
            label_list=[str(i) for i in range(14)],
        )
github PaddlePaddle / PaddleHub / paddlehub / dataset / inews.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "inews")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()
github PaddlePaddle / PaddleHub / paddlehub / dataset / stanford_dogs.py View on Github external
def __init__(self):
        super(StanfordDogsDataset, self).__init__()
        dataset_path = os.path.join(hub.common.dir.DATA_HOME,
                                    "StanfordDogs-120")
        self.base_path = self._download_dataset(
            dataset_path=dataset_path,
            url="https://bj.bcebos.com/paddlehub-dataset/StanfordDogs-120.tar.gz"
        )
        self.train_list_file = "train_list.txt"
        self.test_list_file = "test_list.txt"
        self.validate_list_file = "validate_list.txt"
        self.label_list_file = "label_list.txt"
        self.num_labels = 120
github PaddlePaddle / PaddleHub / paddlehub / dataset / chnsenticorp.py View on Github external
def __init__(self):
        self.dataset_dir = os.path.join(DATA_HOME, "chnsenticorp")
        if not os.path.exists(self.dataset_dir):
            ret, tips, self.dataset_dir = default_downloader.download_file_and_uncompress(
                url=_DATA_URL, save_path=DATA_HOME, print_progress=True)
        else:
            logger.info("Dataset {} already cached.".format(self.dataset_dir))

        self._load_train_examples()
        self._load_test_examples()
        self._load_dev_examples()