Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 2-what-are-vector.mdx #53

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/7-vector-search/2-what-are-vector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Thanks to some of the latest advances in AI, we can now use vectors to represent

Vectors can even be used to represent images, audio, and video, but we'll focus on text in this workshop.

## Why Do We Need Vectors?
## Why do we need vectors?

Computers can't understand text. They can only understand numbers. So, we need a way to convert text into numbers. That's where vectors come in.

Using vectors, we can plot text in a multi-dimensional space. It is hard to visualize a multi-dimensional space, so let's start with a 2-dimensional space.
Using vectors, we can plot text in a multi-dimensional space. It is hard to visualize a multi-dimensional space, so let's start with a two-dimensional space.

Imagine a plot with a x and y axis. Our ML model will plot various points on this plot. This could represent words, sentences, paragraphs, documents, or even images.
Imagine a plot with an x and y axis. Our ML model will plot various points on this plot. This could represent words, sentences, paragraphs, documents, or even images.

The position where the points are plotted is determined by the model you used. The models converts the data you passed it into a vector. Then, it plots the vector on the chart.
The position where the points are plotted is determined by the model you used. The model converts the data you passed it into a vector. Then, it plots the vector on the chart.

![Points on a chart](/img/7-vector-search/1-vectors.png)

Expand All @@ -40,8 +40,8 @@ Vector search also provides a cosine algorithm. Using cosine distance, the close

![Closest words](/img/7-vector-search/4-cosine.png)

## How Do We Create Vectors?
## How do we create vectors?

The big breakthrough with GenAI is that developers can now easily use models that have been pre-trained, and made available freely online. These models have been trained on huge datasets, and are able to convert text (or any sort of data, really) into vectors.
The big breakthrough with GenAI is that developers can now easily use models that have been pre-trained and made available freely online. These models have been trained on huge datasets and are able to convert text (or any sort of data, really) into vectors.

There are many ways to create vectors. In this workshop, we'll use a pre-trained model and an API that will return vectors for us.
There are many ways to create vectors. In this workshop, we'll use a pre-trained model and an API that will return vectors for us.