I modified the tutorial’s per_device_train_batch_size and per_device_eval_batch_size to a smaller size and the example is now reproducible. Thanks!
On the other hand, I don’t know how can I map the string labels to int. I tried the following:
from sklearn.preprocessing import LabelEncoder

label_encoder = LabelEncoder()
label_encoder.fit(train_dataset["LABEL"])
train_dataset.map(lambda examples: {"LABEL": label_encoder.transform(examples["LABEL"])})

And it is giving me the following error:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-15-16ebda6fb306> in <module>()
      3 label_encoder = LabelEncoder()
      4 label_encoder.fit(train_dataset["LABEL"])
----> 5 train_dataset.map(lambda examples: {"LABEL": label_encoder.transform(examples["LABEL"])})

4 frames
/usr/local/lib/python3.6/dist-packages/nlp/arrow_dataset.py in map(self, function, with_indices, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, verbose)
    856         test_inputs = self[:2] if batched else self[0]
    857         test_indices = [0, 1] if batched else 0
--> 858         update_data = does_function_return_dict(test_inputs, test_indices)
    859 
    860         class NumExamplesMismatch(Exception):

/usr/local/lib/python3.6/dist-packages/nlp/arrow_dataset.py in does_function_return_dict(inputs, indices)
    829         def does_function_return_dict(inputs, indices):
    830             """ Does the function returns a dict. """
--> 831             processed_inputs = function(inputs, indices) if with_indices else function(inputs)
    832             does_return_dict = isinstance(processed_inputs, Mapping)
    833 

<ipython-input-15-16ebda6fb306> in <lambda>(examples)
      3 label_encoder = LabelEncoder()
      4 label_encoder.fit(train_dataset["LABEL"])
----> 5 train_dataset.map(lambda examples: {"LABEL": label_encoder.transform(examples["LABEL"])})

/usr/local/lib/python3.6/dist-packages/sklearn/preprocessing/_label.py in transform(self, y)
    266         """
    267         check_is_fitted(self)
--> 268         y = column_or_1d(y, warn=True)
    269         # transform of empty array is empty array
    270         if _num_samples(y) == 0:

/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py in column_or_1d(y, warn)
    795         return np.ravel(y)
    796 
--> 797     raise ValueError("bad input shape {0}".format(shape))
    798 
    799 

ValueError: bad input shape ()

I am suspecting that if I could configure the features of the dataset when loading it, the library would handle this automatically. However, I am unable to do so. This is what I tried to do:
train_dataset, validation_dataset = nlp.load_dataset(
    "csv",
    delimiter="\t",
    data_files={"train": "spanish_train.csv", "validation": "spanish_val.csv"},
    split=["train", "validation"],
    features=nlp.Features({
        "id_str": nlp.Value("float64"),
        "TWEET": nlp.Value("string"),
        "LABEL": nlp.ClassLabel(names=["AGAINST", "FAVOR", "NEUTRAL"])
    }),
)

But when I check the train_dataset.features value I am still getting the same information as in my previous post. If I try to use nlp.Features.from_dict like this:
train_dataset, validation_dataset = nlp.load_dataset(
    "csv",
    delimiter="\t",
    data_files={"train": "spanish_train.csv", "validation": "spanish_val.csv"},
    split=["train", "validation"],
    features=nlp.Features.from_dict({
        "id_str": {
                "dtype": "string",
                "_type": "Value"
        },
        "LABEL": {
                "names": ["AGAINST", "FAVOR", "NEUTRAL"],
                "_type": "ClassLabel"
        },
        "TWEET": {
                "dtype": "string",
                "_type": "Value"
        }
    }),
)

It doesn’t take it into account just like in the first example.
Can someone provide a working example of how to properly specify the features of this dataset, please?