# Near-duplicate detection

> Find repeated text in a retrieval corpus with MinHash banding, exact Jaccard similarity over word windows, and connected groups. On the pinned 400-document corpus, 16 bands of 4 coordinates score 77 candidates out of 79,800 possible pairs and recover all 62 pairs above the inclusive 0.6 threshold.

Find repeated text in a retrieval corpus with MinHash banding, exact Jaccard similarity over word windows, and connected groups. On the pinned 400-document corpus, 16 bands of 4 coordinates score 77 candidates out of 79,800 possible pairs and recover all 62 pairs above the inclusive 0.6 threshold.

## Result

> On a pinned 400-document corpus, 16 bands of 4 score 77 of 79,800 possible pairs and recover all 62 pairs above 0.6

## Modules

* [`knotkit/scalar-sketch`](/modules/scalar-sketch/): Provides reducible Bloom filter, HyperLogLog, Count-Min Sketch, and MinHash sketches over four scalar domains
* [`knotkit/inverted-index`](/modules/inverted-index/): Indexes records by exact keys and scans sorted record IDs for one key or the union of several, using packed posting lists
* [`knotkit/disjoint-set`](/modules/disjoint-set/): Tracks which elements belong to the same set, with dense-index, object, and struct-of-arrays layouts
* [`knotkit/distance`](/modules/distance/): Compares vectors, probability distributions, and sets and exposes each rule’s mathematical guarantees

## Figures

* MinHash banding scored 77 of 79,800 pairs.
* 62/62 reference matches recovered at Jaccard >= 0.6.
* 400 simulated documents | 16 bands x 4 rows | MinHash seed 42

Hover or focus a chart for exact values. Drawn by [`demo.ts`](https://github.com/jkomyno/knotkit/blob/main/problems/near-duplicate-detection/demo.ts) at build time, from the fixtures the benchmark uses; it reproduces the README figure.

## Reproduce

```bash
git clone https://github.com/jkomyno/knotkit.git && cd knotkit && bun install
bun run demo:problem:near-duplicate-detection
```

[`problems/near-duplicate-detection/README.md`](https://github.com/jkomyno/knotkit/blob/main/problems/near-duplicate-detection/README.md) states the fixture, the seed, and the result table.
