Satyajeet Jadhav

a year ago

Cosine Similarity

cosine similarity is used in computer science to group data, or to find data as a response to a query.

it is the cosine of the angle between two vectors.

if the angle is 90, cos(90) = 0 - not similar

if the angle is 0, cos(0) = 1 - same

if the angle is 180, cos(180) = -1 - opposite

To compare two sentences, you need to find the cosine similarity between the numerical representation of the two sentences. Embeddings are numerical representations of words or sentences. Embedding models are offered by OpenAI, Cohere, etc. Their apis take a sentence and return the embeddings.

59 views

Comments

Participate in the conversation.

Never miss a post from
Satyajeet Jadhav

Get notified when Satyajeet Jadhav publishes a new post.

Read More

Satyajeet Jadhav

Semantic Search, aka Magic

The related notes feature searches all your notes to find the ones that are closest in meaning to your current note.Searching notes to find text similar in meaning to your query is called semantic search. We are trying to build a semantic search engine.

Semantic Search, aka Magic
Adithya Venkatesan

On satisficing — a bet on human irrationality

When consumers can’t determine the optimal solution, they give a brand the power of their decisions. It’s why many choose Apple, because they’ve abrogated the rationality of choice. This has to be viewed with care though. The corollary of it is valid too. Think about the below st...