-
Notifications
You must be signed in to change notification settings - Fork 12
[BLOG] Semantic Search #31
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
base: main
Are you sure you want to change the base?
Conversation
| 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`. |
There was a problem hiding this comment.
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?
chatasweetie
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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)
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.