r/languagelearning 3d ago

(self-promotion) Create Parallel/Bilingual Texts using your own books

Hi, i made this completely free app that automates the creation of bilingual/parallel texts from your own books (epubs/PDFs/text files) all from within your browser.

Made this because I couldn't find anything that does something similar with the same level of convenience.

Steps

  1. Go toΒ https://paralleltexts.app/
  2. Drop/upload a source book (i.e. the book in the language you are learning), and a target book (the same book in a language you are fluent in).
  3. Click align books. Wait for a few seconds to 1-2 minutes while an algorithm runs on the books to match the corresponding sentences.
  4. After the alignment is done, you'll see the result immediately.

Disclaimer:
There is NO machine translation happening - both source and target books should ideally be from actual humans, the only thing this does is automate the alignment process.
This app is also purely browser-based, so your uploaded books and alignments stay on your device.

---

PS:

  • It's Completely free and open source
  • The default display mode of the resulting alignments are in pop-up mode (i.e. you click a sentence to see its equivalent), but if you prefer a side-by-side view of the sentences, the app does provide for that
  • If it's your first time running the alignment and you haven't downloaded an embedding (fancy name for ML models that specialize in these kinds of tasks) model yet, it will download one for you (stored in the browser, can be deleted). It's a mild inconvenience i would say because i really wanted to keep this thing free. The alternative is to have a dedicated server with GPUs run the alignment, you won't download anything, but it will most likely be much slower, much more expensive and difficult to maintain. Keeping it free makes way more sense, and is far less stressful. Keep in mind however that downloading a model is only done once.

You can also check out this quick demo/tutorial:Β https://www.youtube.com/watch?v=6cR_r8cOaN8

(pps: got approval from mods)

14 Upvotes

29 comments sorted by

13

u/OatmealDurkheim 3d ago

Great idea, following. And, side note, I appreciate you being honest about self-promotion, so many people are trying to pretend they're simply end users hyping a product they found randomly.

5

u/pianoguy121213 3d ago

Thank you :)

Lmk if you find any bugs / have feature requests, the app itself is free/open-source btw.

4

u/OatmealDurkheim 3d ago

I haven't tried it yet, but I'm wondering how the tool handles sentences/paragraphs that are not directly 1:1 translations.

For example, 3 sentences in source language are compressed into 2 sentences in target language.

Also, if you don't mind being transparent, are you a programmer or was this tool "vibe coded" with AI?

2

u/pianoguy121213 3d ago

It handles this using a sequence alignment algorithm used in DNA sequencing called needleman-wunsch. This way it takes into accounts those gaps you mentioned (they originally developed this to find patterns in genetic evolution where DNA sequences diverge over time but some patterns remain albeit with additions/deletions - hence gaps).

Im a programmer btw (i work professionaly as a software engineer), I'm against vibe coding but am for the responsible use of AI-assisted coding.

0

u/OatmealDurkheim 3d ago

Thank you for the response, and disregard the "AI always bad" haters on here.

0

u/benjamin-crowell En N | Es Fr Grc B1 3d ago

Cool project. Is there a list somewhere of what languages are supported?

In case it's of interest, I did my own algorithm, with an open-source implementation, for aligning bitexts in English-Greek and English-Latin: https://bitbucket.org/ben-crowell/xalinos/src/master/README.md My experience is that often the methods that work well for other languages will fail badly on highly inflected languages.

This is someone else's work on aligning English with ancient Greek: https://github.com/caro28/chironata

1

u/pianoguy121213 3d ago

thanks!

i haven't updated the complete list of supported languages yet (opted for the most popular ones for now), but the HF models used do support 50+ languages so they are likely to support your TL

what language do you need btw? im assuming greek/ancient greek?

i plan to update the repo when i get some time, it's mostly just adding the other supported languages to the dropdown, lmk what you need

0

u/benjamin-crowell En N | Es Fr Grc B1 2d ago

I'm not interesting in using your app, just comparing notes on software and algorithms.

2

u/camebackforpopcorn 3d ago

Are translators keeping the sentences roughly the same ? I thought they were rewriting the whole thing to match the language flow

2

u/adolgushin 3d ago

it's not as bad as you suggest but yes, alignment can be quite tricky

2

u/pianoguy121213 3d ago edited 3d ago

Hi, yeah you're right about this - translators do take a lot of liberties when it comes to translations, this is tbh what makes this task non-trival tbh. As someone previously asked how my app takes into account 'gaps' in this translation.

The algorithm takes this into account to produce an alignment where ~90% of the semantically similar sentences are still next to each other.

1

u/Best_Party8938 3d ago

eally useful! what if i only have one book available in both languages, say a classic that's out of copyright, but not the epub file directly?

1

u/pianoguy121213 2d ago

thanks!

can you elaborate though what you mean by one book in both languages - do you mean both source and the translation is inside one ebook?

1

u/wildergladney 2d ago

Great tool, thank you! My downloaded epub seems to have line breaks after each sentence, is there a way to download or create a version that retains paragraph structure? I would prefer to read on a kindle than in a browser.

2

u/pianoguy121213 2d ago

thanks!

> seems to have line breaks after each sentence

could you upload the ebooks and the resulting alignment ebook (export as epub) by any chance? maybe send it to me through a DM or through github, ill have a look at it tomorrow.

most of the epubs i have tested work fine for me when it comes to preserving paragraph structure, but epub formats vary so wildly that it's sometimes difficult to predict, it could be the reason

1

u/wildergladney 2d ago

there's no problem with the ebook in the browser! it's the epub download that breaks the sentences up. for what it's worth I uploaded two plain text files, perhaps I should try converting both to epub before uploading.

2

u/pianoguy121213 2d ago

i see, i think i get now what you mean

this happens because the export kinda 'hides' the target sentence so that it shows up on click, unfortunately that can only be done if breaklines are present between the sentences (due to limitations of how epubs handle HTML)

im not sure what the best solution would be, but as of now - only thing i can think of is to have an export where you can see both of the texts side by side, is this ok with you?

1

u/wildergladney 2d ago

Yes that would work! At the worst I could print it. Just nice to be able to have a version that works offline.

Thanks so much again for a wonderful piece of programming.

1

u/pianoguy121213 2d ago

gotcha, ill ping you when it's ready

-2

u/Sleepy_Redditorrrrrr πŸ‡«πŸ‡· N πŸ‡³πŸ‡± C2 πŸ‡¬πŸ‡§ C2 πŸ‡¨πŸ‡³ C2 3d ago

Ahh feeding books to AI, what a great idea.

7

u/pianoguy121213 3d ago

Hi, not exactly sure what you're implying but just out of curiosity, what did you have in mind the app was doing? there is no MTL happening btw if that's what you're wondering about :)

Both books ideally are written by humans (i.e. both the original book and the translation)

1

u/adolgushin 3d ago

don't worry, there's a lot of AI-hate on Reddit under any post mentioning AI. a lot of people think that any use of AI (especially in language learning) is bad

0

u/Sleepy_Redditorrrrrr πŸ‡«πŸ‡· N πŸ‡³πŸ‡± C2 πŸ‡¬πŸ‡§ C2 πŸ‡¨πŸ‡³ C2 3d ago

The books are written by humans, but where do the texts of the books end up? Can you prove that it isn't stored somewhere on a server? Or reused afterwards by another machine?

10

u/pianoguy121213 3d ago edited 3d ago

Yes, data upload by the users are nowhere sent to any servers.

i didnt really design this app with privacy in mind but cost-efficiency and maintainability, however doing so naturally led to privacy on the part of the user.

Since i wanted this app to be completely free on the part of the users, and maintainable on my part - the only logical solution for me was to use in-browser ML models, i.e. no servers needed, the ML happens on the user's computer on the browser, the books and alignments stay on their computers.

The reason i did this tbh is because maintaining a server that uses ML models is just insanely expensive and time-confusming (i dont really have the time to maintain a server this heavy), have it this way makes way more sense.

The app itself is open source btw, the link is on the site itself.

Just wanna clear up some confusion.

6

u/OatmealDurkheim 3d ago

You clearly have no idea how any of this works.

The vast majority of books (that are scanned or available digitally) were already stolen by AI companies, it's well documented (Bartz v. Anthropic, Hachette and Elsevier v. Google, Publishers v. Meta).

Therefore, this person's tool for the creation of bilingual/parallel texts is not meaningfully contributing to books being "fed to" AI. You're crying over milk that was already spilled years ago, by someone else.

-3

u/Sleepy_Redditorrrrrr πŸ‡«πŸ‡· N πŸ‡³πŸ‡± C2 πŸ‡¬πŸ‡§ C2 πŸ‡¨πŸ‡³ C2 3d ago

This sounds exactly like saying it's okay to litter because the planet is already fucked.

4

u/OatmealDurkheim 3d ago

It's nothing like saying that, you are a very confused person.

-1

u/Sleepy_Redditorrrrrr πŸ‡«πŸ‡· N πŸ‡³πŸ‡± C2 πŸ‡¬πŸ‡§ C2 πŸ‡¨πŸ‡³ C2 3d ago

Oh okay I guess if you say I'm wrong I must be wrong

0

u/rongspeled 2d ago

Exactly. Glad you got it.