Data¶
Dataset¶
- class supar.utils.data.Dataset(transform, data, **kwargs)[source]¶
Dataset that is compatible with
torch.utils.data.Dataset, serving as a wrapper for manipulating all data fields with the operating behaviours defined inTransform. The data fields of all the instantiated sentences can be accessed as an attribute of the dataset.- Parameters
transform (Transform) – An instance of
Transformor its derivations. The instance holds a series of loading and processing behaviours with regard to the specific data format.data (list[list] or str) – A list of instances or a filename that will be passed into
transform.load().kwargs (dict) – Together with data, kwargs will be passed into
transform.load()to control the loading behaviour.