Hello,
I create a dataset object with the purpose to use map. However, when I try to call the function map, I get the error that the object has no attribute map.
Any ideas how to fix this?
class MyDataset(Dataset):
def __init__(self, text, tags):
self.sentence = text
self.tags_per_token = tags
def __getitem__(self, idx):
sentence = self.sentence[idx]
tags_per_token = self.tags_per_token[idx]
#return one_text, one_label
return {"text_words": one_text,"tags":tags_per_token}
def __len__(self):
return len(self.tags_per_token)
dataset_train = MyDataset(train_data, train_tags)
dataset_train.map(
my_function,
batched=True)
AttributeError: 'MyDataset' object has no attribute 'map'