cazyundee commited on
Commit
43f97a4
·
1 Parent(s): cc68a12

sync: from ael backend/space/

Browse files
Files changed (1) hide show
  1. rerank.py +9 -1
rerank.py CHANGED
@@ -113,7 +113,15 @@ MIN_RESULTS = 1
113
  # the rest in engine order is strictly better than judging none: the survivors
114
  # are reordered by relevance and the rejects are dropped, and the untested tail
115
  # keeps the order the race gave it.
116
- MAX_SCORED = int(os.environ.get("AEL_RERANK_MAX", "6"))
 
 
 
 
 
 
 
 
117
 
118
  # Recent (query, scores) for threshold tuning. Bounded so a long-lived Space
119
  # cannot grow without limit.
 
113
  # the rest in engine order is strictly better than judging none: the survivors
114
  # are reordered by relevance and the rejects are dropped, and the untested tail
115
  # keeps the order the race gave it.
116
+ #
117
+ # 10, from measurement: production runs at ~150ms a document on the Space's
118
+ # CPU, and the race hands over 8. At the old cap of 6 the last two results were
119
+ # never judged, and an unjudged result is the one thing that re-admits exactly
120
+ # the junk this stage exists to remove — "capital of Peru" still came back with
121
+ # a Granta short story and a Nat Geo photo in it. The cap is now above a full
122
+ # result set, so the tail is normally empty; the budget below is what actually
123
+ # bounds the work, and this is only a backstop against a pathologically long set.
124
+ MAX_SCORED = int(os.environ.get("AEL_RERANK_MAX", "10"))
125
 
126
  # Recent (query, scores) for threshold tuning. Bounded so a long-lived Space
127
  # cannot grow without limit.