Dataset

BaseDataset

The base class BaseDataset inherits the tfds.core.GeneratorBasedBuilder and Registry, which makes subclasses registerable.

Custom dataset

Take the glue_zh dataset as an example as following:

@BaseDataset.register("glue_zh")
class GlueZh(BaseDataset):
    ...

The development follows tensorflow_dataset’s specification.