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.ts
import { 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

0.5
    topics.ts
    import { classify } from "relatinator";
    
    const topics = [{ tag: "space", description: "black holes, gravitational waves" }];
    const best = classify(topics, text, { ratio });