Try relatinator in your browser
Everything here runs in your browser with the same package you install from npm. The posts are the six from the playground folder in the repo.
Related posts
related.tsimport { createModel } from "relatinator";
const posts = [{ id: "post-one", content: "…" }];
const model = createModel(posts, { method });
const related = model.findRelatedScored(id);
const why = model.explainRelated(id, otherId);Topics from a fixed list
topics.tsimport { classify } from "relatinator";
const topics = [{ tag: "space", description: "black holes, gravitational waves" }];
const best = classify(topics, text, { ratio });