Thanks for this, but I’m getting an error for the last piece of the code:
posts = load_dataset('peixian/rtGender', 'posts', split = 'train')
print(posts)
posts[0]

# save out a list of unique post_ids for the training and then dev sets
# split train 70%/ dev 15% / test 15%

# split twice and combine
train_devtest = posts.train_test_split(shuffle = True, seed = 200, test_size=0.3)
posts_dev_test = train_devtest['test'].train_test_split(shuffle = True, seed = 200, test_size=0.50)
posts_train_dev_test_dataset = DatasetDict({
    'train': train_devtest['train'],
    'test': posts_dev_test['test'],
    'dev': posts_dev_test['train']})

NameError: name ‘DatasetDict’ is not defined