Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CosineSimilarity ¶
CosineSimilarity calculates the cosine similarity between two vectors. If CUDA is available, it will use GPU for computation.
func GPUDotProduct ¶
GPUDotProduct calculates the dot product using GPU (if available).
func TextSimilarity ¶
TextSimilarity calculates the cosine similarity between two texts by converting them into vectors first.
Types ¶
type Vector ¶
Vector represents a vector in n-dimensional space.
func NewVectorFromText ¶
NewVectorFromText creates a new vector from a given text by tokenizing it into words and counting their occurrences.
func (*Vector) DotProduct ¶
DotProduct calculates the dot product of two vectors.
Click to show internal directories.
Click to hide internal directories.