我在迭代中翻译数千个文本数据时遇到此错误:
Expecting value: line 1 column 1 (char 0)
Run Code Online (Sandbox Code Playgroud)
我翻译大量文本的代码:
translatedList = []
for index, row in df.iterrows():
newrow = copy.deepcopy(row)
try:
# translate the 'text' column
translated = translator.translate(row['text'], dest='en')
newrow['translated'] = translated.text
except Exception as e:
print(str(e))
continue
translatedList.append(newrow)
Run Code Online (Sandbox Code Playgroud)
翻译大约2-3k行后,我收到此错误.