here is the full error:
---------------------------------------------------------------------------
ArrowInvalid                              
Traceback (most recent call last)
<ipython-input-2-ee0b34ea20c7> in <module>
      1 # loop through Dataset using Dataset map function for tokenization
----> 2 train_dataset = ds_train.map(tokenize)

/opt/anaconda3/lib/python3.8/site-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)
    942                     example = apply_function_on_filtered_inputs(example, i)
    943                     if update_data:
--> 944                         writer.write(example)
    945             else:
    946                 for i in tqdm(range(0, len(self), batch_size), disable=not verbose):

/opt/anaconda3/lib/python3.8/site-packages/nlp/arrow_writer.py in write(self, example, writer_batch_size)
    175             writer_batch_size = self.writer_batch_size
    176         if writer_batch_size is not None and len(self.current_rows) >= writer_batch_size:
--> 177             self.write_on_file()
    178 
    179     def write_batch(

/opt/anaconda3/lib/python3.8/site-packages/nlp/arrow_writer.py in write_on_file(self)
    139         type = None if self.update_features and self.pa_writer is None else self._type
    140         if self.current_rows:
--> 141             pa_array = pa.array(self.current_rows, type=type)
    142             first_example = pa.array(self.current_rows[0:1], type=type)[0]
    143             # Sanity check

/opt/anaconda3/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array()

/opt/anaconda3/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array()

/opt/anaconda3/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status()

ArrowInvalid: Could not convert tensor([[  101,  8499,  4642,  1106,  5307,  1614,  1166,  1114, 27157,  2101,
          1656,  1733,   119,  4613,   117,  2631,   113, 13597,   114,  5554,
          8499,   112,   188,  1207, 13715,   176, 12328,  1500,  3215,  1786,
          1656,  1733,  1120,   170,   185, 14695,  8037,  1303,  1113,  9170,
          1115,  1103, 26961,  1524,   118,  6057,  1110,  1231,  7867, 27885,
          1103,  1226,   107,  1115,  1119,   112,   188,  1151,  1773,   107,
          1105,  1110,  2407,   102]]) with type Tensor: did not recognize Python value type when inferring an Arrow data type