whatisgithub

What is bilingual-book-builder?

kerivin/bilingual-book-builder — explained in plain English

Analysis updated 2026-05-18

11PythonAudience · generalComplexity · 3/5Setup · moderate

In one sentence

A command line tool that merges two ePub translations of the same book into one bilingual ePub with matching sentences shown side by side.

Mindmap

mindmap
  root((repo))
    What it does
      Merges two ePubs
      Aligns sentences
      Side by side layout
    Tech stack
      Python
      bertalign
      LaBSE
    Use cases
      Bilingual reading
      Language learning
      Chapter alignment tuning
    Audience
      Language learners
      Readers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn an original book and its translation into a single ePub for side by side bilingual reading.

USE CASE 2

Practice a new language by reading original sentences next to their translation in one file.

USE CASE 3

Fine-tune chapter matching and sentence alignment for books in less common language pairs.

What is it built with?

PythonbertalignLaBSEWtpsplit

How does it compare?

kerivin/bilingual-book-builder2arons/llm-cliabe238/claude-video-plus
Stars111111
LanguagePythonPythonPython
Setup difficultymoderateeasyeasy
Complexity3/52/53/5
Audiencegeneraldeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs pip install with a GPU or CPU variant, and works best if you specify source and target languages.

So what is it?

bilingual-book-builder is a command line tool that takes two ePub versions of the same book, one in the original language and one translated, and combines them into a single new ePub with matching sentences placed side by side. The goal is to help someone read a book in a foreign language while seeing the original sentence right next to its translation. The process runs in three stages, and each stage relies on its own set of language models, so overall language support depends on all three working together. First, if you do not specify the languages yourself, a detector figures out what language each book is written in. Second, the text of each book is split into individual sentences, either with a fast simple splitter that covers two dozen languages or a more capable model based splitter that covers many more. Third, a sentence alignment model matches corresponding sentences between the two books using a technique called bertalign. The author notes that even languages not officially listed by these tools often still work in practice. You can install it with pip, choosing a version built for a machine with a graphics card or one for CPU only, or you can try it online through a hosted demo on HuggingFace, which the README warns is fairly slow and blocked in some regions. Once installed, the basic command just points at a source ePub and a target ePub, and the tool auto detects languages, matches chapters between the two books, and produces one merged bilingual ePub. There are many optional settings for tuning speed against accuracy: you can name the source and target languages directly to skip detection, control how many threads run in parallel, adjust how strictly chapters are matched, choose which book's cover art to keep, and swap in different alignment or splitting models if the defaults do not suit your languages. Chapters can also be matched manually instead of automatically if the automatic matching gets it wrong. The author is upfront that results depend heavily on the quality of the source ePubs, since messy tables of contents or missing metadata can throw off chapter matching, and mentions the code was written with AI assistance. Known limitations include some chapters being missed entirely, loss of text styling like bold and italics, and the tool currently only supporting a side by side layout rather than a stacked one.

Copy-paste prompts

Prompt 1
Show me the bbb command to merge original.epub and translation.epub with auto-detected languages.
Prompt 2
Explain the difference between --simple-split and the model based sentence splitter in bilingual-book-builder.
Prompt 3
Help me manually match chapters with the -m flag when auto-matching gets the chapter order wrong.

Frequently asked questions

What is bilingual-book-builder?

A command line tool that merges two ePub translations of the same book into one bilingual ePub with matching sentences shown side by side.

What language is bilingual-book-builder written in?

Mainly Python. The stack also includes Python, bertalign, LaBSE.

How hard is bilingual-book-builder to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is bilingual-book-builder for?

Mainly general.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.