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

使用back_translate翻译时间太长了,有没有办法是他们的翻译时间变短,由5分钟变成几秒钟? #5

Open
LiZhangMing opened this issue Apr 26, 2021 · 1 comment

Comments

@LiZhangMing
Copy link

LiZhangMing commented Apr 26, 2021

schemas = json.load(open("./input/schemas.json", "r"))
keywords = [line.strip() for line in open("./input/keywords.txt", "r")]
result=back_translate("XXX撒", schemas,keywords)
print(json.dumps(handle_res(result), indent=4, ensure_ascii=False))
@yym6472
Copy link
Owner

yym6472 commented Apr 26, 2021

schema里的每一项都需要两次调用翻译接口。然后因为目前用的是公开破解的翻译接口,所以会有调用频率的限制,每次调用之间会间隔1~2秒,加上翻译的网络延迟,确实会需要几分钟。如果您的需求就是翻译单条数据(而不是批处理)的话,可以尝试把代码中默认的延迟时间改小一些;如果有批处理的需求的话,就只能去使用各个平台的翻译api了

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