Hi !
In this code you call train_test_split without setting a seed, which means that every time you run this code, it will shuffle the dataset in a different way. Since the created splits are always different, it can’t reload them from cache. You can use train_test_split(test_size=0.2, seed=...) to set the seed.
Furthermore, you are loading a dataset that is in memory. By default caching is enabled only for datasets on disk. What you can do is load an on-disk dataset using load_dataset("text", data_files=dataset_f). Another option is to write the dataset on disk at one point dataset.map(..., cache_file_name=<path/to/cache/file>)