DeepLcom / deepl-api-issues

Issue tracking repository for the DeepL API.
MIT License
0 stars 0 forks source link

Empty translation result and no exception raised #5

Open kdorichev opened 1 year ago

kdorichev commented 1 year ago

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 1 year ago

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'.