Skip to content

Commit

Permalink
Setting k to 50 in the scripts.
Browse files Browse the repository at this point in the history
Signed-off-by: jzonthemtn <[email protected]>
  • Loading branch information
jzonthemtn committed Dec 12, 2024
1 parent 57a530c commit e8de8ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ echo "Deleting existing judgments index..."
curl -s -X DELETE http://localhost:9200/judgments

echo "Creating judgments..."
curl -s -X POST "http://localhost:9200/_plugins/search_quality_eval/judgments?click_model=coec&max_rank=10"
curl -s -X POST "http://localhost:9200/_plugins/search_quality_eval/judgments?click_model=coec&max_rank=50"
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash -e

QUERY_SET_ID="dcbf3db4-56ea-47cd-87ea-3d13d067ae7a"
JUDGMENTS_ID="78f0e4e4-1cbf-47b4-9737-5feef65dad4d"
QUERY_SET_ID="09fc2a69-9bc0-49ea-9747-aefd66528858"
JUDGMENTS_ID="cd7b72c9-21fa-4500-abf3-722438ab3ad4"
INDEX="ecommerce"
ID_FIELD="asin"
K="10"
K="50"
THRESHOLD="1.0" # Default value

curl -s -X DELETE "http://localhost:9200/sqe_metrics_sample_data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public String calculateJudgments() throws Exception {

// Calculate and index the click-through rate for query/doc pairs.
LOGGER.info("Beginning calculation of clickthrough rates.");
final Map<String, Set<ClickthroughRate>> clickthroughRates = getClickthroughRate(maxRank);
final Map<String, Set<ClickthroughRate>> clickthroughRates = getClickthroughRate();
LOGGER.info("Clickthrough rates for number of queries: {}", clickthroughRates.size());
showClickthroughRates(clickthroughRates);

Expand Down Expand Up @@ -175,11 +175,10 @@ public String calculateCoec(final Map<Integer, Double> rankAggregatedClickThroug

/**
* Gets the clickthrough rates for each query and its results.
* @param maxRank The maximum rank position to consider.
* @return A map of user_query to the clickthrough rate for each query result.
* @throws IOException Thrown when a problem accessing OpenSearch.
*/
private Map<String, Set<ClickthroughRate>> getClickthroughRate(final int maxRank) throws Exception {
private Map<String, Set<ClickthroughRate>> getClickthroughRate() throws Exception {

// For each query:
// - Get each document returned in that query (in the QueryResponse object).
Expand All @@ -205,7 +204,7 @@ private Map<String, Set<ClickthroughRate>> getClickthroughRate(final int maxRank
" {\n" +
" \"range\": {\n" +
" \"event_attributes.position.ordinal\": {\n" +
" \"lte\": " + maxRank + "\n" +
" \"lte\": " + parameters.getMaxRank() + "\n" +
" }\n" +
" }\n" +
" }\n" +
Expand Down

0 comments on commit e8de8ec

Please sign in to comment.