Empty translation result and no exception raised
kdorichev opened this issue · 1 comments
kdorichev commented
deepl.version == '1.15.0'
try:
result = translator.translate_text(
"把警车还给我这是妈妈给我买的,我的就不给你玩啦啦啦啦啦啦妈妈,哥哥打警车抢走了,那是我的。",
source_lang='ZH', target_lang='EN'
)
except deepl.exceptions.ConnectionException:
error("Translation error", "Connection exaeption")
except deepl.exceptions.QuotaExceededException:
error("Translation error", "Quota exceeded")
except deepl.exceptions.DeepLException:
error("Translation error", "DeepL Exception")
else:
if len(result.text) == 0:
print('EMPTY result')
else:
print(result.text)
EMPTY result
JanEbbing commented
The same thing happens in the web translator, it works if you remove the "。" character at the end. I have reported this to our language model team and will report back here, sorry for this.
Nit: target_lang='EN' is deprecated, you need to decide between target_lang='EN-GB' and target_lang='EN-US'.