Skip to content

Commit

Permalink
reduce adjust limits since we now look for the nearest term
Browse files Browse the repository at this point in the history
  • Loading branch information
havardpe committed Nov 3, 2024
1 parent 3affac7 commit 1877bb2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
42 changes: 21 additions & 21 deletions tests/performance/wand_stopwords/MicroBmSearcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ public Result search(Query weakAndQuery, Execution execution) {
execution.fill(andResult);
var andSet = getHitIds(andResult);

Query weakAndQueryA20 = changeRoot(weakAndQuery, new WeakAndItem());
weakAndQueryA20.properties().set("rankproperty.vespa.matching.weakand.stop_word_adjust_limit", "0.20");
Result weakAndResultA20 = execution.search(weakAndQueryA20);
execution.fill(weakAndResultA20);
var weakAndSetA20 = getHitIds(weakAndResultA20);

Query weakAndQueryA05 = changeRoot(weakAndQuery, new WeakAndItem());
weakAndQueryA05.properties().set("rankproperty.vespa.matching.weakand.stop_word_adjust_limit", "0.05");
Result weakAndResultA05 = execution.search(weakAndQueryA05);
execution.fill(weakAndResultA05);
var weakAndSetA05 = getHitIds(weakAndResultA05);
Query weakAndQueryA10 = changeRoot(weakAndQuery, new WeakAndItem());
weakAndQueryA10.properties().set("rankproperty.vespa.matching.weakand.stop_word_adjust_limit", "0.10");
Result weakAndResultA10 = execution.search(weakAndQueryA10);
execution.fill(weakAndResultA10);
var weakAndSetA10 = getHitIds(weakAndResultA10);

Query weakAndQueryA02 = changeRoot(weakAndQuery, new WeakAndItem());
weakAndQueryA02.properties().set("rankproperty.vespa.matching.weakand.stop_word_adjust_limit", "0.02");
Result weakAndResultA02 = execution.search(weakAndQueryA02);
execution.fill(weakAndResultA02);
var weakAndSetA02 = getHitIds(weakAndResultA02);

Query weakAndQueryS20 = changeRoot(weakAndQuery, new WeakAndItem());
weakAndQueryS20.properties().set("rankproperty.vespa.matching.weakand.stop_word_score_limit", "0.20");
Expand All @@ -127,16 +127,16 @@ public Result search(Query weakAndQuery, Execution execution) {
var weakAndSetD05 = getHitIds(weakAndResultD05);

Query weakAndQueryX = changeRoot(weakAndQuery, new WeakAndItem());
weakAndQueryX.properties().set("rankproperty.vespa.matching.weakand.stop_word_adjust_limit", "0.02");
weakAndQueryX.properties().set("rankproperty.vespa.matching.weakand.stop_word_drop_limit", "0.20");
weakAndQueryX.properties().set("rankproperty.vespa.matching.weakand.stop_word_adjust_limit", "0.01");
weakAndQueryX.properties().set("rankproperty.vespa.matching.weakand.stop_word_drop_limit", "0.30");
Result weakAndResultX = execution.search(weakAndQueryX);
execution.fill(weakAndResultX);
var weakAndSetX = getHitIds(weakAndResultX);

// double orTime = timeQuery(orQuery, execution, 1);
double weakAndTime = timeQuery(weakAndQuery, execution);
double weakAndTimeA20 = timeQuery(weakAndQueryA20, execution);
double weakAndTimeA05 = timeQuery(weakAndQueryA05, execution);
double weakAndTimeA10 = timeQuery(weakAndQueryA10, execution);
double weakAndTimeA02 = timeQuery(weakAndQueryA02, execution);
double weakAndTimeS20 = timeQuery(weakAndQueryS20, execution);
double weakAndTimeS05 = timeQuery(weakAndQueryS05, execution);
double weakAndTimeD20 = timeQuery(weakAndQueryD20, execution);
Expand All @@ -148,8 +148,8 @@ public Result search(Query weakAndQuery, Execution execution) {
meta.setMeta(true);
meta.setField("andQuality", quality(orSet, andSet));
meta.setField("weakAndQuality", quality(orSet, weakAndSet));
meta.setField("weakAndQualityA20", quality(orSet, weakAndSetA20));
meta.setField("weakAndQualityA05", quality(orSet, weakAndSetA05));
meta.setField("weakAndQualityA10", quality(orSet, weakAndSetA10));
meta.setField("weakAndQualityA02", quality(orSet, weakAndSetA02));
meta.setField("weakAndQualityS20", quality(orSet, weakAndSetS20));
meta.setField("weakAndQualityS05", quality(orSet, weakAndSetS05));
meta.setField("weakAndQualityD20", quality(orSet, weakAndSetD20));
Expand All @@ -158,8 +158,8 @@ public Result search(Query weakAndQuery, Execution execution) {
meta.setField("orHits", orResult.getTotalHitCount());
meta.setField("andHits", andResult.getTotalHitCount());
meta.setField("weakAndHits", weakAndResult.getTotalHitCount());
meta.setField("weakAndHitsA20", weakAndResultA20.getTotalHitCount());
meta.setField("weakAndHitsA05", weakAndResultA05.getTotalHitCount());
meta.setField("weakAndHitsA10", weakAndResultA10.getTotalHitCount());
meta.setField("weakAndHitsA02", weakAndResultA02.getTotalHitCount());
meta.setField("weakAndHitsS20", weakAndResultS20.getTotalHitCount());
meta.setField("weakAndHitsS05", weakAndResultS05.getTotalHitCount());
meta.setField("weakAndHitsD20", weakAndResultD20.getTotalHitCount());
Expand All @@ -168,8 +168,8 @@ public Result search(Query weakAndQuery, Execution execution) {
meta.setField("orTime", orTime);
meta.setField("andTime", andTime);
meta.setField("weakAndTime", weakAndTime);
meta.setField("weakAndTimeA20", weakAndTimeA20);
meta.setField("weakAndTimeA05", weakAndTimeA05);
meta.setField("weakAndTimeA10", weakAndTimeA10);
meta.setField("weakAndTimeA02", weakAndTimeA02);
meta.setField("weakAndTimeS20", weakAndTimeS20);
meta.setField("weakAndTimeS05", weakAndTimeS05);
meta.setField("weakAndTimeD20", weakAndTimeD20);
Expand Down
36 changes: 18 additions & 18 deletions tests/performance/wand_stopwords/wand_stopwords.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def measure_wand_quality
andQ = []
orQ = []
waQ = []
waA20Q = []
waA05Q = []
waA10Q = []
waA02Q = []
waS20Q = []
waS05Q = []
waD20Q = []
Expand All @@ -79,8 +79,8 @@ def measure_wand_quality
andH = []
orH = []
waH = []
waA20H = []
waA05H = []
waA10H = []
waA02H = []
waS20H = []
waS05H = []
waD20H = []
Expand All @@ -89,8 +89,8 @@ def measure_wand_quality
andT = []
orT = []
waT = []
waA20T = []
waA05T = []
waA10T = []
waA02T = []
waS20T = []
waS05T = []
waD20T = []
Expand All @@ -108,8 +108,8 @@ def measure_wand_quality
h = r.hit[0]
andQ.append(h.field['andQuality'])
waQ.append(h.field['weakAndQuality'])
waA20Q.append(h.field['weakAndQualityA20'])
waA05Q.append(h.field['weakAndQualityA05'])
waA10Q.append(h.field['weakAndQualityA10'])
waA02Q.append(h.field['weakAndQualityA02'])
waS20Q.append(h.field['weakAndQualityS20'])
waS05Q.append(h.field['weakAndQualityS05'])
waD20Q.append(h.field['weakAndQualityD20'])
Expand All @@ -118,8 +118,8 @@ def measure_wand_quality
andH.append(h.field['andHits'])
orH.append(h.field['orHits'])
waH.append(h.field['weakAndHits'])
waA20H.append(h.field['weakAndHitsA20'])
waA05H.append(h.field['weakAndHitsA05'])
waA10H.append(h.field['weakAndHitsA10'])
waA02H.append(h.field['weakAndHitsA02'])
waS20H.append(h.field['weakAndHitsS20'])
waS05H.append(h.field['weakAndHitsS05'])
waD20H.append(h.field['weakAndHitsD20'])
Expand All @@ -128,8 +128,8 @@ def measure_wand_quality
andT.append(h.field['andTime'])
orT.append(h.field['orTime'])
waT.append(h.field['weakAndTime'])
waA20T.append(h.field['weakAndTimeA20'])
waA05T.append(h.field['weakAndTimeA05'])
waA10T.append(h.field['weakAndTimeA10'])
waA02T.append(h.field['weakAndTimeA02'])
waS20T.append(h.field['weakAndTimeS20'])
waS05T.append(h.field['weakAndTimeS05'])
waD20T.append(h.field['weakAndTimeD20'])
Expand All @@ -149,8 +149,8 @@ def measure_wand_quality
puts "== Average and median over #{sz} results =="
process("AND-recall", "recall@100", andQ)
process("WeakAnd-recall", "recall@100", waQ)
process("WeakAnd-A20-recall", "recall@100", waA20Q)
process("WeakAnd-A5-recall", "recall@100", waA05Q)
process("WeakAnd-A10-recall", "recall@100", waA10Q)
process("WeakAnd-A2-recall", "recall@100", waA02Q)
process("WeakAnd-S20-recall", "recall@100", waS20Q)
process("WeakAnd-S5-recall", "recall@100", waS05Q)
process("WeakAnd-D20-recall", "recall@100", waD20Q)
Expand All @@ -159,8 +159,8 @@ def measure_wand_quality

process("AND-hits", "hits", andH)
process("WeakAnd-hits", "hits", waH)
process("WeakAnd-A20-hits", "hits", waA20H)
process("WeakAnd-A5-hits", "hits", waA05H)
process("WeakAnd-A10-hits", "hits", waA10H)
process("WeakAnd-A2-hits", "hits", waA02H)
process("WeakAnd-S20-hits", "hits", waS20H)
process("WeakAnd-S5-hits", "hits", waS05H)
process("WeakAnd-D20-hits", "hits", waD20H)
Expand All @@ -170,8 +170,8 @@ def measure_wand_quality

process("AND-ms", "latency", andT)
process("WeakAnd-ms", "latency", waT)
process("WeakAnd-A20-ms", "latency", waA20T)
process("WeakAnd-A5-ms", "latency", waA05T)
process("WeakAnd-A10-ms", "latency", waA10T)
process("WeakAnd-A2-ms", "latency", waA02T)
process("WeakAnd-S20-ms", "latency", waS20T)
process("WeakAnd-S5-ms", "latency", waS05T)
process("WeakAnd-D20-ms", "latency", waD20T)
Expand Down

0 comments on commit 1877bb2

Please sign in to comment.