Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python translate large texts to English [closed]

I am searching for a Python library that translates very large texts to English. I have already used TextBlob (which at some point just stops translating, API limits I suppose), googletrans (which at some point also just stops translating, it also doesn't translate very large texts and I have to split them into pieces and then merge). I am looking for a solution that I can be sure that it won't stop working, since I will be running this code regularly on around 100K texts with average word length of 10K. If anyone has done something similar, I would appreciate your help!

like image 944
Petar Avatar asked Apr 07 '26 20:04

Petar


2 Answers

Python library dl-translate gets the job done very well. It is based on Huggingface transformers, with 2 available model options - mBART-50 Large (50 languages, personally I find it to be very accurate) and m2m100 (100 languages, but slightly less accurate). Link to github: https://github.com/xhluca/dl-translate

like image 195
Sggg Avatar answered Apr 10 '26 16:04

Sggg


the Deepl API allows you to get 500k caracters every month, would this be enought? https://www.deepl.com/en/docs-api/

might not be, but I wanted to be sure

like image 29
Ren Avatar answered Apr 10 '26 18:04

Ren