/** * Profile text embeddings → researcher similarity + collaboration prediction (#1501). * * The #1501 "node2vec embeddings" slot, implemented (per operator decision) by * reusing the text-embedding backend (#1493) instead of a heavy graph-embedding * stack: each person profile is embedded from its name + the titles of its * corpus-refs, then cosine similarity gives nearest researchers and * collaboration link-prediction (highly-similar people who have NOT co-authored — * corpus-refs overlap is the co-authorship proxy). * * Opt-in: requires `@xenova/transformers` (and `hnswlib-node` is not needed here — * similarity is an in-memory cosine over the ~hundreds of person profiles). * Degrades gracefully when the optional dep is absent. * * @source historical: profiles/graph_embeddings.py (node2vec → text-embedding here) * @tests @test/unit/artifacts/profile-embed.test.ts */ export interface ProfileEmbeddings { profIds: string[]; names: (string | null)[]; vectors: number[][]; /** profId index → set of its corpus-refs (co-authorship proxy). */ refs: Set[]; } export interface SimilarHit { profId: string; name: string | null; score: number; } export interface CollabPrediction { a: string; b: string; score: number; } /** * Build text embeddings for person profiles. Text = profile name + the titles of * its corpus-refs. Requires `@xenova/transformers`; throws a clear error when absent. */ export declare function buildProfileEmbeddings(corpusRoot: string, model?: string): Promise; /** Nearest researchers to a profile by embedding cosine (excludes self). */ export declare function profileSimilar(emb: ProfileEmbeddings, profId: string, topK?: number): SimilarHit[]; /** * Collaboration link-prediction: pairs of people with embedding similarity ≥ * threshold who share NO corpus-refs (i.e. have not co-authored). Ranked desc. */ export declare function collaborationPredictions(emb: ProfileEmbeddings, threshold?: number, limit?: number): CollabPrediction[]; export declare function renderSimilar(profId: string, hits: SimilarHit[]): string; export declare function renderCollabPredictions(preds: CollabPrediction[], threshold: number): string; //# sourceMappingURL=profile-embed.d.ts.map