fix TypeError: TextEncodeInput must be Union[TextInputSequence, Tuple[InputSequence, InputSequence]]

Published on Aug. 22, 2023, 12:10 p.m.

通过将列转换为字符串,然后将其转换为列表,然后将其拆分为训练段和测试段来修复它。

train_texts = train[‘text’].astype(str).values.to_list()

links:
https://stackoverflow.com/questions/63517293/valueerror-textencodeinput-must-be-uniontextinputsequence-tupleinputsequence