LibreTranslate/RemoveDup

Remove duplicates from parallel corpora

8

stars

28

commits

C++

primary language

Jun 15, 2026

updated

clean
deduplication
duplicates
llm

README

RemoveDup

A fast, memory efficient Python module to remove duplicates from parallel text corpora.

It's useful for cleaning up datasets that contain duplicate entries for training language models.

Installation

pip install removedup

Usage

from removedup import rdup

src, tgt, removed = rdup("source.txt", "target.txt")
print(src, tgt, removed)
# source.txt.dedup
# target.txt.dedup
# <num lines removed>

Notes

Source and target must have the same number of lines. No validation checks are made.

Duplication checks are made both on the source and target content. E.g. duplication needs to appear on both source and target.

This is a breaking change from versions < 1.1.0.

Build

git clone https://github.com/LibreTranslate/RemoveDup
cd RemoveDup
python setup.py build

Standalone Binary

You can also use removedup as a standalone Windows, macOS or Linux application (but you currently need to build from source, we don't provide binaries).

mkdir build
cd build && cmake .. && make -j4
./rdup source.txt target.txt

Contributing

We welcome pull requests!

License

AGPLv3

Contributors

pierotofy

28 commits

LibreTranslate/RemoveDup

Remove duplicates from parallel corpora

8

stars

28

commits

C++

primary language

Jun 15, 2026

updated

clean
deduplication
duplicates
llm

README

RemoveDup

A fast, memory efficient Python module to remove duplicates from parallel text corpora.

It's useful for cleaning up datasets that contain duplicate entries for training language models.

Installation

pip install removedup

Usage

from removedup import rdup

src, tgt, removed = rdup("source.txt", "target.txt")
print(src, tgt, removed)
# source.txt.dedup
# target.txt.dedup
# <num lines removed>

Notes

Source and target must have the same number of lines. No validation checks are made.

Duplication checks are made both on the source and target content. E.g. duplication needs to appear on both source and target.

This is a breaking change from versions < 1.1.0.

Build

git clone https://github.com/LibreTranslate/RemoveDup
cd RemoveDup
python setup.py build

Standalone Binary

You can also use removedup as a standalone Windows, macOS or Linux application (but you currently need to build from source, we don't provide binaries).

mkdir build
cd build && cmake .. && make -j4
./rdup source.txt target.txt

Contributing

We welcome pull requests!

License

AGPLv3

Contributors

pierotofy

28 commits

Languages

C++

48.9%

Python

45.4%

CMake

5.7%