Member-only story

Vector Embeddings, Search Similarity & Sentence-Transformers

Kavya Goyal
3 min readOct 9, 2024

--

Today, we will work with understand similarity with vector search on an n-dimensional space and what does it mean to use sentence-transformers

Vectors in space and Similarity

In multi-dimensional spaces, the similarity of vectors can be found out by how close they are in the space and how much they overlap. One such metric to measure it is Cosine Similarity. Attaching a wonderful article here that talks about what cosine-similarty is in simple words.

Consider the following 2D space where

X Axis: Definition of gender. X > 0 represents female (Quadrant 1, Quadrant 4)

and

Y Axis: Definition of age. Y > 0 represents age > 18 (Quadrant 1, Quadrant 2)

Now, consider the following statements

Person-1: A 10 Year Old Boy

Person-2: A 80 Year Old Woman

Person-3: A 2 Year Old Boy

Person-4: A 28 Year Old Woman

Person-5: A 32 Year Old Man

If we had to create vectors solely on the information given above-

--

--

Kavya Goyal
Kavya Goyal

Written by Kavya Goyal

SWE II at Apollo.io. Coder by Day, Learner by Night, Writing by Passion. I talk about AI and Programming. https://www.linkedin.com/in/kavya-goyal-313ba6194/

No responses yet