尝试使用 BERT 模型制作文本情感分类器,但得到ValueError : too many dimensions 'str'
这是列车数据值的 DataFrame;所以它们是train_labels
0 notr
1 notr
2 notr
3 negative
4 notr
... ...
854 positive
855 notr
856 notr
857 notr
858 positive
Run Code Online (Sandbox Code Playgroud)
并且有代码产生错误
train_seq = torch.tensor(tokens_train['input_ids'])
train_mask = torch.tensor(tokens_train['attention_mask'])
train_y = torch.tensor(train_labels.tolist())
Run Code Online (Sandbox Code Playgroud)
At train_y = torch.tensor(train_labels.tolist());出现错误:
ValueError: too many dimensions 'str'
你能帮我吗

