1Z0-184-25 Question 19
Single answerYou are designing a semantic text search application in Oracle Cloud Infrastructure. You store both user queries and document embeddings using vector indexes in an Oracle NoSQL Database. However, your initial results do not convey the expected semantic relationships between texts. Which vector distance metric is generally recommended for measuring semantic similarity in text embeddings to improve the accuracy of your search results?
- A
Cosine distance
- B
Euclidean distance
- C
Manhattan distance
- D
Dot product
Show answer and explanation
Correct answer: A
Explanation
In semantic search applications involving text embeddings, the primary goal is to compare directions of vectors rather than their magnitudes. Cosine distance (or similarity) excels at this, making it the metric of choice for text-based AI workflows in Oracle Cloud Infrastructure. For more details and best practices, refer to Oracle� documentation on using vector distance metrics with Oracle NoSQL Database and other OCI AI Services.
- A. Correct.
Cosine distance (correct): Cosine distance (or similarity, when inverted) is preferred for many text embedding use cases because it measures the orientation between vectors, emphasizing semantic similarity rather than magnitude. When embeddings are normalized, cosine distance helps accurately capture how 'alike' two text embeddings are in direction.
- B. Incorrect.
Euclidean distance (incorrect): While Euclidean distance calculates the geometric distance in vector space, it is more sensitive to vector magnitude than orientation. Text embeddings often vary in length, which can distort semantic comparisons when using Euclidean distance alone.
- C. Incorrect.
Manhattan distance (incorrect): Manhattan distance, computed by summing the absolute differences along each dimension, is not commonly used for linguistic embeddings. It focuses on the total distance rather than direction, making it less effective for semantic matching.
- D. Incorrect.
Dot product (incorrect): A raw dot product can be useful in certain ranking or similarity scenarios, but unless embeddings are consistently normalized, simply relying on the dot product may not accurately capture semantic similarity. Cosine-based approaches typically yield better results for text embeddings.