similarity

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeNeuralSimilarityForDoc added in v0.2.0

func ComputeNeuralSimilarityForDoc(st *store.Store, docID, modelID string, threshold float64) error

ComputeNeuralSimilarityForDoc recomputes neural similar_to edges for a single document against all other documents that share the same model_id embedding. Existing neural edges for docID are replaced. Uses the stored similarity threshold from project_metadata (default 0.25).

func ComputeSimilarity

func ComputeSimilarity(st *store.Store, threshold float64) error

ComputeSimilarity computes pairwise topic similarity between all documents using a hybrid of TF-IDF text similarity, shared reference targets, and tag overlap. Edges of kind "similar_to" are inserted for pairs whose composite score meets the threshold.

func ComputeSimilarityIncremental added in v0.2.0

func ComputeSimilarityIncremental(st *store.Store, changedDocIDs []string, threshold float64) error

ComputeSimilarityIncremental recomputes similar_to edges for docs in changedDocIDs only, leaving other pairs untouched. Falls back to a full rebuild when: changedDocIDs is empty, k > n/2, or the threshold changed.

IDF drift note: adding a new doc shifts IDF for its terms, which can slightly alter scores for unchanged pairs. These pairs are corrected on their next change or a forced full rebuild (--force on index).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL