Skip to content

Conversation

@zateutsch
Copy link
Contributor

Would love a review of this is any of you have time, still need to put links and images in but content and grammar review would be great.

1. The text embeddings are output by the inference session.
1. These are token-by-token embeddings, so the embeddings for each sequence must be averaged to get an embedding for the entire string.
1. Now that `sourceText` and `searchQuery` have been embedded, a search can be performed to find the chunks of text from `sourceText` that most closely match the meaning of the `searchQuery`. This is done by calculating the distance between two embeddings.
1. The closest matches are output as semantic matches for the `searchQuery`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you get back to text from the embeddings?

@zateutsch zateutsch changed the title [BLOG} Semantic Search [BLOG] Semantic Search Mar 28, 2025
Copy link
Contributor

@chatasweetie chatasweetie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came out great and I can't wait to see the images you use to help visual folks

// Get the length of each of the input sequences by dividing the total length by the count
int sequenceLength = input.InputIds.Length / count;

// Create input tensors over the input data using count and sequence length to define the shape
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if tensors is a common known word, if you think so great (I had to look it up and https://www.w3schools.com/ai/ai_tensors.asp is a great resource)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants