Which pair of Snowflake Cortex functions should be used together to determine the semantic similarity between documents?
Determining semantic similarity between documents in Snowflake Cortex requires two steps: first, converting the document text into numerical vector representations using an embedding function (the EMBED_TEXT family, e.g., EMBED_TEXT_768/EMBED_TEXT_1024), and second, comparing those vectors using a distance or similarity function such as VECTOR_L2_DISTANCE, which computes the Euclidean distance between two vectors—smaller distances indicate greater semantic similarity. COMPLETE generates text completions from a prompt, SUMMARIZE condenses a document into a shorter summary, and EXTRACT_ANSWER pulls a specific answer from a document given a question—none of these measure similarity between two pieces of text.
Community Discussion