To apply the preprocessing function over the entire dataset, use 🤗 Datasets [~datasets.Dataset.map] function. You can speed up the map function by setting batched=True to process multiple elements of the dataset at once:

tokenized_wnut = wnut.map(tokenize_and_align_labels, batched=True)