title: With BERT Text Classification, ValueError: too many dimensions 'str' error occuring
body: <p>Trying to make a classifier for sentiments of texts with BERT model but getting <code>ValueError : too many dimensions 'str'</code></p>
  <p>That is the DataFrame for values of train data; so they are train_labels</p>
  <pre><code>0   notr
  1   notr
  2   notr
  3   negative
  4   notr
  ... ...
  854 positive
  855 notr
  856 notr
  857 notr
  858 positive
  </code></pre>
  <p>and there is the code which is producing the error for</p>
  <pre><code>train_seq = torch.tensor(tokens_train['input_ids'])
  train_mask = torch.tensor(tokens_train['attention_mask'])
  train_y = torch.tensor(train_labels.tolist())
  </code></pre>
  <p><code>At train_y = torch.tensor(train_labels.tolist());</code> getting error:
  <code>ValueError: too many dimensions 'str'</code></p>
  <p>can you help me please<a href="https://i.stack.imgur.com/SWCNC.png" rel="noreferrer">enter image description here</a></p>
  <p><a href="https://i.stack.imgur.com/mJLfB.png" rel="noreferrer">enter image description here</a></p>