File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1010EPSILON = 1.1920929e-7 # https://doc.rust-lang.org/std/f32/constant.EPSILON.html
1111# https://github.com/qdrant/qdrant/blob/7164ac4a5987d28f1c93f5712aef8e09e7d93555/lib/segment/src/spaces/simple_avx.rs#L99C10-L99C10
1212
13+ NAIVE_FEEDBACK_CONFIDENCE_MARGIN = 0.0
14+
1315
1416class DistanceOrder (str , Enum ):
1517 BIGGER_IS_BETTER = "bigger_is_better"
@@ -57,6 +59,7 @@ class ContextQuery:
5759 def __init__ (self , context_pairs : list [ContextPair ]):
5860 self .context_pairs = context_pairs
5961
62+
6063class FeedbackItem :
6164 def __init__ (self , vector : list [float ], score : float ):
6265 self .vector = np .array (vector )
@@ -336,6 +339,7 @@ def calculate_context_scores(
336339
337340 return overall_scores
338341
342+
339343def calculate_naive_feedback_query (
340344 query : NaiveFeedbackQuery , vectors : types .NumpyArray , distance_type : models .Distance
341345) -> types .NumpyArray :
@@ -345,7 +349,7 @@ def calculate_naive_feedback_query(
345349 positive_item , negative_item = p [0 ], p [1 ]
346350 confidence = positive_item .score - negative_item .score
347351
348- if confidence <= 0.0 :
352+ if confidence <= NAIVE_FEEDBACK_CONFIDENCE_MARGIN :
349353 continue
350354
351355 partial_computation = (confidence ** query .coefficients .b ) * query .coefficients .c
You can’t perform that action at this time.
0 commit comments