pyabsa.tasks.RNARegression.dataset_utils.__classic__.data_utils_for_inference

Module Contents

Classes

GloVeRNARDataset

An abstract class representing a Dataset.

class pyabsa.tasks.RNARegression.dataset_utils.__classic__.data_utils_for_inference.GloVeRNARDataset(config, tokenizer)[source]

Bases: torch.utils.data.Dataset

An abstract class representing a Dataset.

All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite __getitem__(), supporting fetching a data sample for a given key. Subclasses could also optionally overwrite __len__(), which is expected to return the size of the dataset by many Sampler implementations and the default options of DataLoader.

Note

DataLoader by default constructs a index sampler that yields integral indices. To make it work with a map-style dataset with non-integral indices/keys, a custom sampler must be provided.

parse_sample(text)[source]
prepare_infer_sample(text: str, ignore_error)[source]
prepare_infer_dataset(infer_file, ignore_error)[source]
process_data(samples, ignore_error=True)[source]
__getitem__(index)[source]
__len__()[source]