I think maybe you should change dataset to Dataset type and then rewrite like this :
tokenized_dataset = dataset_1.map(lambda x: tokenizer(x[‘words’],  is_split_into_words=True,return_tensors=“pt”, padding=‘max_length’, truncation=True, max_length=128)
I think you donot need to loop into dataset_1  but rather pass the column words dataset_1[‘words’] directly to the tokenizer or  transform to Dataset format. Datasets — datasets 1.16.1 documentation 1