Spaces:
Running
Name channel weight 0.5 -> 1.0; it could never reach the top k
Browse filesThe name channel shipped at weight 0.5 and could never fire. RRF scores a
rank-r hit at weight/(60+r); with the relevance pool at k*10 the vector channel
reaches ~1/140 at its tail, so a name-only hit at 0.5/60 lost to every vector
result down to rank ~60 and could not enter the top k. Live check after deploy:
"iSAID" still returned Icelandic census records and chip-design netlists.
Weight is now 1.0 -- equal to the vector channel, which is right for a query that
literally is a repo name. False positives are held at the trigger (identifier-
shaped tokens matched at an id boundary), not by de-weighting the channel.
The fixture test missed this because it fused a 3-item pool against 20
distractors, which passes at any weight. It now uses the real pool depth
(_rerank_pool) and a full k, and fails at 0.5.
|
@@ -373,7 +373,13 @@ def _bm25_ids(kind: str, text: str, n: int) -> list:
|
|
| 373 |
# channel that can find them.
|
| 374 |
_NAME_MAX_TOKENS = 3 # "iSAID instance segmentation" still carries a name token
|
| 375 |
_NAME_MIN_CHARS = 4 # shorter tokens ("ocr", "sam") match far too much
|
| 376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 377 |
|
| 378 |
# Hyphenated descriptors that pass the identifier test but name no repo.
|
| 379 |
_NAME_STOPWORDS = frozenset({"real-time", "state-of-the-art", "open-source", "fine-tuned"})
|
|
|
|
| 373 |
# channel that can find them.
|
| 374 |
_NAME_MAX_TOKENS = 3 # "iSAID instance segmentation" still carries a name token
|
| 375 |
_NAME_MIN_CHARS = 4 # shorter tokens ("ocr", "sam") match far too much
|
| 376 |
+
# Equal to the vector channel. RRF scores a rank-r hit at weight/(60+r), so the
|
| 377 |
+
# vector pool (k*10) reaches ~1/140 at its tail while a name-only hit sits at
|
| 378 |
+
# weight/60. At 0.5 such a hit loses to every vector result down to rank ~60 and so
|
| 379 |
+
# can never enter the top k — which is the entire point of the channel. False
|
| 380 |
+
# positives are held back at the trigger (identifier-shaped tokens, matched at an
|
| 381 |
+
# id boundary) rather than by de-weighting the whole channel.
|
| 382 |
+
NAME_CHANNEL_WEIGHT = 1.0
|
| 383 |
|
| 384 |
# Hyphenated descriptors that pass the identifier test but name no repo.
|
| 385 |
_NAME_STOPWORDS = frozenset({"real-time", "state-of-the-art", "open-source", "fine-tuned"})
|