dipu-bd / lightnovel-crawler

Generate and download e-books from online sources.
https://pypi.org/project/lightnovel-crawler/
GNU General Public License v3.0
1.42k stars 279 forks source link

Embed a bergamot translator in crawler #1829

Open KonoromiHimaries opened 1 year ago

KonoromiHimaries commented 1 year ago

It would be cool if the crawler would have, though machine-made, the ability to translate from the original, for example, english into your native language (everyone has his own)

See Bergamot Translator https://github.com/browsermt/bergamot-translator

Bergamot translator provides a unified API for (Marian NMT framework based) neural machine translation functionality in accordance with the Bergamot project that focuses on improving client-side machine translation in a web browser.

dipu-bd commented 1 year ago

The idea of using a translator feature was requested before, but it was rejected thinking about the costs. If you know some light-weight package (low on dependency and size) in python, let me know.

KonoromiHimaries commented 1 year ago

I don't know, maybe https://github.com/galuhsahid/mariantranslate

see https://pypi.org/search/?q=marian

dipu-bd commented 1 year ago

The package uses this library for translation: https://github.com/Helsinki-NLP/Opus-MT

I am not sure how good the output will be. MTLs are generally not very readable.

KonoromiHimaries commented 1 year ago

For now i use this https://github.com/soimort/translate-shell at output text files and works somehow on google translator.

for f in *.txt; do trans -e google en:pl file://"$f" -o trans/"$f" ; done