Skip to content

Commit

Permalink
CrateDB: Vector Store -- update docs in _euclidean_relevance_score_fn
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Nov 20, 2024
1 parent 09db9e4 commit 4b9310e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ def _euclidean_relevance_score_fn(similarity: float) -> float:
# (0 is most similar, sqrt(2) most dissimilar)
# to a similarity function (0 to 1)

# Original:
# return 1.0 - distance / math.sqrt(2)
# CrateDB uses the `vector_similarity()` SQL function in this context,
# which already returns a normalized value.
# https://cratedb.com/docs/crate/reference/en/latest/general/builtins/scalar-functions.html#vector-similarity-float-vector-float-vector
return similarity

0 comments on commit 4b9310e

Please sign in to comment.