Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty translation result and no exception raised #5

Open
kdorichev opened this issue Sep 25, 2023 · 1 comment
Open

Empty translation result and no exception raised #5

kdorichev opened this issue Sep 25, 2023 · 1 comment

Comments

@kdorichev
Copy link

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
Copy link
Member

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

@JanEbbing JanEbbing transferred this issue from DeepLcom/deepl-python Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants