Calculates the straight-line L2 distance between two text embeddings, providing a natural measure of semantic difference in the vector space.
output
(str): The generated text to be evaluated.expectedOutput
(str): The reference or ground truth text.Result
(float): A distance score from 0 to infinity.0
: The embeddings are identical.The score is sensitive to vector magnitude.
x_i
and y_i
are the components of the vectors at dimension i
.