'''
Author: jianzhnie
Date: 2022-03-11 11:15:41
LastEditTime: 2022-03-11 16:11:17
LastEditors: jianzhnie
Description:

'''
from pprint import pprint

from datasets import load_dataset

if __name__ == '__main__':
    # 加载数据集
    root_dir = 'data/aclImdb/'
    imdb_dataset = load_dataset('examples/dataset_examples/custom_imdb.py',
                                data_dir=root_dir)
    print(imdb_dataset)
    print('Length of training set: ', len(imdb_dataset))
    print('First example from the dataset: \n')
    pprint(imdb_dataset['train'][:2])
    pprint(imdb_dataset['test'][:2])
    pprint(imdb_dataset['unsupervised'][:2])

'''
Author: jianzhnie
Date: 2022-03-11 11:15:41
LastEditTime: 2022-03-11 16:11:17
LastEditors: jianzhnie
Description:

'''
from pprint import pprint

from datasets import load_dataset

if __name__ == '__main__':
    # 加载数据集
    root_dir = 'data/aclImdb/'
    imdb_dataset = load_dataset('examples/dataset_examples/custom_imdb.py',
                                data_dir=root_dir)
    print(imdb_dataset)
    print('Length of training set: ', len(imdb_dataset))
    print('First example from the dataset: \n')
    pprint(imdb_dataset['train'][:2])
    pprint(imdb_dataset['test'][:2])
    pprint(imdb_dataset['unsupervised'][:2])

Author: jianzhnie Date: 2022-03-11 11:15:41 LastEditTime: 2022-03-11 16:11:17 LastEditors: jianzhnie Description: # 加载数据集