

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Semantic Search
incomplete
2: Embeddings
incomplete
3: Embedding Models
incomplete
4: Model Selection
incomplete
5: Vector Operations
incomplete
6: Dimensions
incomplete
7: Dot Product Similarity
incomplete
8: Cosine Similarity
incomplete
9: Why Cosine Similarity?
incomplete
10: Generating Text Embeddings
incomplete
11: Document Embeddings
incomplete
12: Query Embeddings
incomplete
13: Same Model
incomplete
14: Implementing Semantic Search
incomplete
15: Locality-Sensitive Hashing
incomplete
16: Vector Databases
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
The tool that powers semantic search is embeddings: numerical representations of text that capture meaning.
Specifically, our embeddings are vectors: a fancy word for a list of numbers. You can think of a vector as a point in space, or as a direction and a magnitude from the origin point (0, 0).
Here are two 2-dimensional vectors:
[3, 2] (3 units right, 2 units up)[1, 2] (1 unit right, 2 units up)Embedding happens when we take a piece of text and convert it into a vector. For example:
[3.5, 2.5][3.0, 2.0][3.0, -3.0]The idea is that the distance between vectors represents how similar the meanings of the words are. King and queen are very similar, so their vectors are close together. Human is less similar, so its vector is further away.
Vector values are often normalized to a smaller floating-point range, such as -1.0 to 1.0, so they're easier to compare.