Azure Data Explorer for Vector Similarity Search
Posted By admin on January 4, 2024
This post is co-authored by@adieldar(Principal Data Scientist, Microsoft)
In the world of AI & data analytics, vector databases are emerging as a powerful tool for managing complex and high-dimensional data.
In this article, we will explore the concept of vector databases, the need for vector databases in data analytics, and how Azure Data Explorer (ADX)aka Kusto can be used as a vector database.
Vector databases store and manage data in the form of vectors that are numerical arrays of data points. Vector databases allow manipulating and analyzing set of vectors at scale using vector algebra and other advanced mathematical techniques.
The use of vectors allows for more complex queries and analyses, as vectors can be compared and analyzed using advanced techniques such as vector similarity search, quantization and clustering.
Traditional databases are not well-suited for handling high-dimensional data, which is becoming increasingly common in data analytics. In contrast, vector databases are designed to handle high-dimensional data, such as text, images, and audio, by representing them as vectors.
This makes vector databases particularly useful for tasks such as machine learning, natural language processing, and image recognition, where the goal is to identify patterns or similarities in large datasets
Vector similarity is a measure of how different (or similar) two or more vectors are.Vector similarity search is a technique used to find similar vectors in a dataset.
In vector similarity search, vectors are compared using a distance metric, such as Euclidean distance or cosine similarity. The closer two vectors are, the more similar they are.
Embeddings are a common way of representing data in a vector format for use in vector databases. An embedding is a mathematical representation of a piece of data, such as a word, text document or an image, that is designed to capture its semantic meaning.
Embeddings are created using algorithms that analyze the data and generate a set of numerical values that represent its key features. For example, an embedding for a word might represent its meaning, its context, and its relationship to other words.
Lets take an example.
Below two phrases are represented as vectors after embedding with a model.
Phrase 1
Phrase 2
(Image credits OpenAI)
Embeddings that are numerically similar are also semantically similar. For example, as seen in the following chart, the embedding vector of canine companions say will be more similar to the embedding vector of woof than that of meow.
(Image credits OpenAI)
they can be created using standard python packages (eg. spaCy, sent2vec, Gensim), but Large Language Models (LLM) generate highest quality embeddings for semantic text search. Thanks to OpenAI and other LLM providers, we can now use them easily. You just send your text to an embedding model in Azure Open AI and it generates a vector representation which can be stored for analysis.
At the core of Vector Similarity Search is the ability to store, index, and query vector data.
ADX is a cloud-based data analytics service that enables users to perform advanced analytics on large datasets in real-time. It is particularly well-suited for handling large volumes of data, making it an excellent choice for storing and searching vectors.
ADX supports a special data type called dynamic, which can store unstructured data such as arrays and property bags. Dynamic data type is perfect for storing vector values. You can further augment the vector value by storing metadata related to the original object as separate columns in your table.
Furthermore, we have added a new user-defined function series_cosine_similarity_fl to perform vector similarity searches on top of the vectors stored in ADX.
ADX as a vector database
Lets say you want to run semantic searches on top of Wikipedia pages.
We will generate vectors for tens of thousands of Wikipedia pages by embedding them with an Open AI model and storing the vectors in ADX along with some metadata related to the page.
Demo scenario
Now we want to search wiki pages with natural language queries to look for the most relevant ones. We can achieve that by the following steps:
Semantic search flow
Lets run some queries:
This query calculates similarity score for thousands of vectors in the table within seconds and returns the top n results.
Search query 1:places where we worship
Result:
Search query 2: unfortunate events in history
Result:
If youd like to try this demo, head to the azure_kusto_vector GitHub repository and follow the instructions.
The Notebook in the repo will allow you to -
You can start by spinning up your own free Kusto cluster within seconds -https://aka.ms/kustofree
We look forward to your feedback and all the exciting things you build with vectors & ADX!
Read more from the original source:
Azure Data Explorer for Vector Similarity Search
- Abortion and Holocaust | News, Sports, Jobs - Williamsport Sun-Gazette [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Rehiring of principal who refused to call Holocaust a fact to be reconsidered - Palm Beach Post [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- This school principal refuses to call the Holocaust a fact. A Jewish youth group is fighting back. - Forward [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Sacha Baron Cohen Broke Tradition on Borat 2 by Revealing His Identity to Holocaust Survivor - IndieWire [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Union Station to host Holocaust exhibit this summer | University News - University News [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Holocaust survivor Eva Kor honored with mural - The Herald [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- The Holocaust-surviving violins that endured atrocities to tell a vital story - Classic FM [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Holocaust survivor shares story to promote change and unity - KEZI TV [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Germany to give $662 million to Holocaust survivors struggling during the coronavirus pandemic - CBS News [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Saul & Ruby's Holocaust Survivor Band Performance and Q&A - jewishboston.com [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Twitter follows Facebook on removing posts that deny the Holocaust - CNBC [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Twitter intends to remove posts denying the Holocaust - Cleveland Jewish News [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Facebook, Twitter on the Right Side of History With Bans on Holocaust Denial - InsideSources [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- History repeats itself: A Holocaust survivor reflects on the election - Forward [Last Updated On: October 21st, 2020] [Originally Added On: October 21st, 2020]
- Adjaye says Holocaust Memorial is a 'crescendo of the moment' - Building Design [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- Tommy Schnurmacher: My parents survived the Holocaust I can get through a pandemic - Montreal Gazette [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- Seton Hill to display never-before-seen photos of Holocaust massacre - TribLIVE [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- Garden honors young victims, survivors of Holocaust - liherald.com [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- Point of View: Facebook, Twitter on the right side of history with bans on Holocaust denial - Palm Beach Post [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- How a Holocaust survivor helped me find love and hope during the pandemic - New York Post [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- 'Becoming a Witness': Teen paints portraits of Holocaust survivors during pandemic - ABC News [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- Opinion: Facebook, Twitter on the Right Side of History With Bans on Holocaust Denial - Prescott eNews [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- An anti-Semitic cake, a Holocaust survivor and a whole lot of Hebrew: All the Jewish moments in 'Borat 2' - JTA News - Jewish Telegraphic Agency [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- This 92-year-old Holocaust survivor has a warning for America about Donald Trump | Opinion - The News Journal [Last Updated On: October 25th, 2020] [Originally Added On: October 25th, 2020]
- After Ottawa monument is vandalized, Ontario adopts International Holocaust Remembrance Alliance's 'working definition of anti-Semitism' -... [Last Updated On: October 28th, 2020] [Originally Added On: October 28th, 2020]
- World attention towards holocaust in Kashmir sought - The News International [Last Updated On: October 28th, 2020] [Originally Added On: October 28th, 2020]
- US Holocaust Museum Reopens to Public With Reduced Visitation - The DC Post [Last Updated On: October 28th, 2020] [Originally Added On: October 28th, 2020]
- The Victims of Trumps Family Separation Policy Will Not Be Fine - Slate [Last Updated On: October 28th, 2020] [Originally Added On: October 28th, 2020]
- South Jersey Holocaust Coalition hosts online program with daughter of Holocaust survivors - nj.com [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- November 8, 1866: Commemorating The Holocaust Of The Arkadi Monastery - GreekCityTimes.com [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Florida Holocaust Museum reopens Monday after being closed for eight months due to the pandemic - ABC Action News [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- My Family, the Holocaust and Me, BBC1, review: An emotional and timely film from Robert Rinder - iNews [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- At virtual vigil, speakers apply lessons of 1938 Nazi violence to today - The Keene Sentinel [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Holocaust History: Raising Awareness of the Significance of the Holocaust Among Young People - Maine Public [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- 'Never again:' Research helps raise impact of Holocaust education - Nebraska Today [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Jesuit Catholic priest pens book about his orders complicity in the Holocaust - The Times of Israel [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- My Family, the Holocaust and Me with Robert Rinder review remarkably moving TV - The Guardian [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- A question rarely asked: Would I have survived the Holocaust? - Forward [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Florida principal refused to call the Holocaust a 'historical event,' appealed termination and was fired again - USA TODAY [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Holocaust survivors in Northeast Ohio reflect on concerning new study - WKYC.com [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Former Oklahoma state representatives call on OU to surrender 'poisoned art' stolen from Holocaust survivor - The Oklahoma Daily [Last Updated On: December 5th, 2020] [Originally Added On: December 5th, 2020]
- 6 prominent Holocaust survivors have died in Europe over the past month - Cleveland Jewish News [Last Updated On: December 5th, 2020] [Originally Added On: December 5th, 2020]
- Wife of WWII Vet Who Died of COVID Has 1 Request: Wear a Mask in Honor of Marty - NBC10 Boston [Last Updated On: December 5th, 2020] [Originally Added On: December 5th, 2020]
- Spiritual Side: Holocaust education at St. Peter Catholic School - The West Volusia Beacon [Last Updated On: December 19th, 2020] [Originally Added On: December 19th, 2020]
- MARK BENNETT: 'We'll get through it,' Holocaust witness, WWII vet says of pandemic - Terre Haute Tribune Star [Last Updated On: December 19th, 2020] [Originally Added On: December 19th, 2020]
- From the Pages of Orlando Weekly: Holocaust Memorial Center Exhibit "Uprooting Prejudice: Faces of Change" - WMFE [Last Updated On: December 19th, 2020] [Originally Added On: December 19th, 2020]
- Holocaust survivors honored with online event amid pandemic - The Associated Press [Last Updated On: December 19th, 2020] [Originally Added On: December 19th, 2020]
- Trump taps Giulianis son for membership on the Holocaust Memorial Council. - The New York Times [Last Updated On: December 19th, 2020] [Originally Added On: December 19th, 2020]
- The lesson of 2020 and 1965: The right to vote is precious and powerful - Milford Daily News [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Doherty: Goodbye and thank you to constituents - Pamplin Media Group [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Opinion | The Holocaust Stole My Youth. Covid-19 Is Stealing My Last Years. - The New York Times [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Holocaust Memorial Center hosts 'Soap Myth' online reading and discussion - The Detroit News [Last Updated On: January 8th, 2021] [Originally Added On: January 8th, 2021]
- The Holocaust Separated This Little Girl And Her Best Friend. Eighty Years Later, The Florida Holocaust Museum Reunited Them. - WMFE [Last Updated On: January 18th, 2021] [Originally Added On: January 18th, 2021]
- Holocaust survivor Sam Weinreb dies at 94 | TribLIVE.com - TribLIVE [Last Updated On: January 18th, 2021] [Originally Added On: January 18th, 2021]
- How legacies of the Holocaust should inform health care - American Medical Association [Last Updated On: January 18th, 2021] [Originally Added On: January 18th, 2021]
- The Jerusalem Quartet to Join With New West Symphony Members for Exclusive Holocaust Remembrance Musical Events - Business Wire [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- CNN partners with the UN, UNESCO and the IHRA for Holocaust Commemoration Day - CNN Press Room [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- Holocaust commission gets new life; atrocities to be recalled this week in Texas, San Antonio - San Antonio Express-News [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- Her family survived the Holocaust, but terror found them in their new home - The Gazette [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- International Holocaust Remembrance Day 2021: 'I Only Wanted to Live' by Mimmo Calopresti - University of Arkansas Newswire [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- How Shanghai saved thousands of Jews from the Holocaust - CNA [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- Holocaust Survivor Q&A on Feb. 11 via Zoom | University of Arkansas - University of Arkansas Newswire [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- 'Hate Never Disappears. It Just Takes a Break for a While.' Why the U.S. Capitol Attack Makes Holocaust Remembrance Day More Important Than Ever -... [Last Updated On: January 26th, 2021] [Originally Added On: January 26th, 2021]
- 99-year-old Montreal man credits luck for surviving the Holocaust - CTV News Montreal [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Jenrick announces free admission to the proposed UK Holocaust Memorial - GOV.UK [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Its not as bad: Holocaust survivor compares the pandemic lockdown to one that was far worse - Global News [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Survivors set to gather at Auschwitz this week for Holocaust Remembrance Week - NewsWest9.com [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Digital Exclusive: The importance of remembering the Holocaust - KCAU 9 [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Florida's Vaccine Rollout Woes, Remembering The Holocaust, Why The Obsession With Orchids? - WLRN [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Six HGI Events Begin with Holocaust Remembrance Day on January 27 - Manhattan College News [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Local Air Force veteran remembers his time in the Holocaust - KATC Lafayette News [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Holocaust survivor from Plattsburgh reflects on trip to Auschwitz and the pandemic - North Country Public Radio [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Daughter of Holocaust survivor spreads message of awareness, education - WZZM13.com [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- She survived the Holocaust. Now, shes getting the COVID-19 vaccine - 9News.com KUSA [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Holocaust Memorial Day: They were rescued from deportation. Now, Jewish orphans reunite. - USA TODAY [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- A London museum wants to challenge common perceptions of the Holocaust - CNN [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- US witnessed 'echoes of the Holocaust' during breach of the Capitol, says concentration camp survivor - UN News [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- File: Holocaust remembrance - Council of Europe [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- The Oscar Schindler Story [Last Updated On: February 1st, 2021] [Originally Added On: February 1st, 2021]
- Holocaust Museums teddy bear and train set carry the weight of genocide - Houston Chronicle [Last Updated On: February 16th, 2021] [Originally Added On: February 16th, 2021]
Comments