feat(page-cluster): add Jaccard similarity and array edit distance primitives#900
Merged
Merged
Conversation
…imitives Add the two structural-distance building blocks a future MinHash/LSH + medoid clustering classifier will need: jaccardSimilarity() for set-based overlap (candidate scoring, medoid merge distance) and arrayEditDistance() for order-sensitive comparisons on tokenize() output (merge-distance refinement, quality checks). Both are parameter-free and independently testable ahead of the classifier itself, whose MinHash/LSH and clustering parameters still need a separate design pass. Validated against a real 302-page crawl of www.d-zero.co.jp: Jaccard similarity on tokenize() output already groups pages into their actual template families (service pages, work/report/news detail pages, tag listings) at a 0.8-0.9 threshold, without any hashing or clustering machinery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jaccardSimilarity()(set-based structural overlap) andarrayEditDistance()(order-sensitive element-wise Levenshtein distance) to@d-zero/page-cluster, as pure, parameter-free building blocks for the future MinHash/LSH + medoid clustering classifier.www.d-zero.co.jp: Jaccard similarity overtokenize()output already groups pages into sensible template families (service pages, work/report/news detail pages, tag listings) at a 0.8–0.9 threshold.Test plan
yarn build(28 projects)yarn lintyarn test(1122 tests)/code-review xhigh— 4 findings, all fixed (orphaned JSDoc, dedup-collapsed test literal,ReadonlySet/naming hardening)/qa-engineer— added a differing-set-size symmetry test to close a coverage gap🤖 Generated with Claude Code