msokolov commented on a change in pull request #235:
URL: https://github.com/apache/lucene/pull/235#discussion_r686734774
##########
File path:
lucene/core/src/java/org/apache/lucene/index/VectorSimilarityFunction.java
##########
@@ -43,9 +43,9 @@ public float compare(float[] v1, float[] v2) {
};
/**
- * If true, the scores associated with vector comparisons are in reverse
order; that is, lower
- * scores represent more similar vectors. Otherwise, if false, higher scores
represent more
- * similar vectors.
+ * If true, the scores associated with vector comparisons are nonnegative
and in reverse order;
+ * that is, lower scores represent more similar vectors. Otherwise, if
false, higher scores
+ * represent more similar vectors, and scores may be negative or positive.
Review comment:
So the current patch did not change the `VectorSimilarity.compare`
function implementations. It does the `1/1+x` normalization in
`VectorsReader.search`, so I think the comment is still valid. I suppose we
could impose a requirement on similarity functions that they always return
[0,1] in ascending-similar order and eliminate the whole notion of reversed
similarities. That would be a nice simplification to the API, and I think we've
shown that it is achievable. But if we do decide that's best, I'd like to do it
separately since it will touch a bunch of places that aren't changed yet in
this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]