관련성이 의미하는 것

읽는 데 약 53분분 걸린다, 11절에 10개 예제이(가) 있음.

2026.11.10판 예제 통과 2026년 11월 19 132개 예제 중 132개 통과 변경 사항

AI로 번역함. 영어 원문을 사람이 검증함. 우리가 책을 만드는 방식

영어판 2026.11.10판을 번역한 것이다. 원문 읽기

이 장을 마치면 관련성 판단 집합을 비판적으로 읽을 수 있다. 각 등급이 상품에 대해 무엇을 주장하는지 설명하고, 판단이 어디에서 나왔고 어디에 빈틈이 있는지 찾으며, 그 판단으로 계산한 점수를 얼마나 신뢰할지 결정할 수 있다.

지금까지의 모든 점수는 상점의 판단을 사실로 받아들였다. 1장에서는 두 랭커를 13,077개의 판단에 비추어 평가했다. 이 판단은 상점에서 입력한 질의와 그 상점이 파는 상품의 쌍에 사람들이 매긴 등급이다. 테스트 질의에서 BM25의 nDCG@10 평균은 0.725이다. 시맨틱 검색의 평균은 0.830이다. 이 수치들은 모두 판단이 암묵적으로 내린 선택 위에 서 있다. 판단이 누구의 관련성 개념을 기록하는지, 아슬아슬하게 빗나간 경우에 얼마의 가치를 주는지, 아무도 판단하지 않은 상품은 어떻게 되는지가 그 선택이다.

이 장은 상점의 판단을 면밀히 읽는다. 랭커는 하나도 바꾸지 않으므로 훈련 질의와 테스트 질의를 구분 없이 읽는다. 판단을 읽는 일은 튜닝이 아니며, 이 책의 모든 개선은 여전히 훈련 질의만으로 선택한다. 이 장이 테스트 질의에서 수행하는 몇 가지 검정은 탐색적이므로 판단을 기술할 뿐 차이를 입증하지는 않는다(이 책의 규칙). BM25와 시맨틱 검색의 격차는 3장에서 계획된 비교로 검정한다.

이 부분은 아직 번역되지 않았으므로 영어로 표시된다.

Judge relevance against the shopper's need

마지막으로 변경된 판: 2026.11.8판

A search system returns products that match a query in the way the system defines a match: shared words for lexical retrieval, nearby vectors for semantic retrieval. Information science calls that system relevance. It separates that from topical relevance, whether a product is about the query's subject, and situational relevance, whether it helps with the task at hand (Saracevic, 2007). Some argue that system relevance is always perfect, because the system retrieved what the query asked for. Saracevic's answer is "Not so."

A judgment is a verdict, and this chapter asks what each grade claims. The store's judgments come from WANDS, a public product-search dataset, through a sample of its queries and products (Load the store's data). WANDS's judges label each pair exact, partial or irrelevant, which the book grades 2, 1 and 0. Exact means the product is the kind of thing the query asks for and has every attribute the query names. Partial means it is the right kind of thing but misses an attribute. Irrelevant means it isn't the kind of thing asked for (Read intent as a product and its modifiers). The judge grades the product against the information need behind the query's words, the thing the shopper wanted, not against the words. Manning et al. define a document as relevant when it addresses the stated information need, not merely because it contains the query's words (Manning et al., 2008, chapter 8). Evaluation then makes a bargain. It fixes a set of documents, a set of need statements and their judgments, and abstracts away the real users (Voorhees, 2007). The judgments stand in for shoppers here, and every score in this book inherits that bargain.

If matching words were the same as relevance, a product whose text holds every word of the query would be exact. You can test that on every judged pair in the store: for each pair, ask whether the product's name, class, category and description contain every word of the query, with the sample's descriptions cut to about 400 characters.

Of the judged pairs whose text holds every query word, what share did the judges call exact? Hold a number in mind.

word-match-versus-judgment.py Python 3.12.15 · numpy 2.5.5 · pandas 3.1.1 통과
"""Checks whether a full word match makes a judged pair exact, and how many exact pairs have a text that misses aquery word, with and without attributes. The prose's point rests on the `of them exact` line and the`of them, still missing one with attributes added` line."""import refrom lib.store import load_labels, load_products, load_queries, product_textdef words(text):    """Lowercase word tokens: a rough stand-in for what lexical search matches."""    return set(re.findall(r"\w+", text.lower()))products, queries, labels = load_products(), load_queries(), load_labels()text_words = {product_id: words(text) for product_id, text in product_text(products).items()}attribute_words = {product_id: words(text) for product_id, text in products["attributes"].items()}query_words = {query_id: words(query) for query_id, query in queries["query"].items()}pairs = list(zip(labels["query_id"], labels["product_id"]))# on sets, <= asks whether every query word is in the product's textlabels["in text"] = [query_words[query_id] <= text_words[product_id] for query_id, product_id in pairs]# | is set union: the product's text words with its attribute words addedlabels["in text or attributes"] = [query_words[query_id] <= text_words[product_id] | attribute_words[product_id]                                   for query_id, product_id in pairs]matched = labels[labels["in text"]]print(f"exact share of all judged pairs: {(labels['label'] == 'exact').mean():.3f}")print(f"judged pairs whose text has every query word: {len(matched):,}")for label in ["exact", "partial", "irrelevant"]:    print(f"of them {label}: {(matched['label'] == label).mean():.3f}")exact = labels[labels["label"] == "exact"]print(f"exact pairs: {len(exact):,}")print(f"exact pairs whose text misses a query word: {(~exact['in text']).sum():,}")print(f"of them, still missing one with attributes added: {(~exact['in text or attributes']).sum():,}")curtains = list(exact.loc[exact["query_id"] == 246, "product_id"])                 # query 246: clear shower curtainunsaid = [product_id for product_id in curtains if "clear" not in text_words[product_id]]print("exact products for clear shower curtain:", len(curtains))print("of them without the word clear in their text:", len(unsaid))print("of those, with clear in their attributes:", sum("clear" in attribute_words[product_id] for product_id in unsaid))
출력python word-match-versus-judgment.py
exact share of all judged pairs: 0.249
judged pairs whose text has every query word: 1,177
of them exact: 0.777
of them partial: 0.211
of them irrelevant: 0.012
exact pairs: 3,252
exact pairs whose text misses a query word: 2,337
of them, still missing one with attributes added: 2,251
exact products for clear shower curtain: 12
of them without the word clear in their text: 8
of those, with clear in their attributes: 4

A full word match is a strong signal, but it doesn't settle the question. Of the 1,177 judged pairs whose text holds every query word, 0.777 are exact, 0.211 partial and 0.012 irrelevant, against an exact share of 0.249 over all judged pairs. The words can be present without the product being what the shopper meant, so the judges decide, not the words. A share near 1 would mean matching words is relevance, and the judges say it isn't.

The other direction is more striking. Most exact pairs, 2,337 of the 3,252, have a product text that misses at least one query word. Adding the attributes still leaves 2,251 of those missing a word, so attributes explain few misses overall.

Some misses are word forms and spelling, such as chairs against chair (chapter 1) or the query ligth bulb. Chapter 5 and chapter 8 take those up. Others are attributes the text doesn't state. WANDS records attributes such as color, material and size apart from the text (Chen et al., 2022, Table 1), and the store keeps a few of them in an attributes column, for example color: clear; material: vinyl (data card). The text the store's search reads, lib.store.product_text, leaves that column out.

For some queries, though, the attributes hold the answer. For clear shower curtain, 8 of the 12 exact products never say clear in their text, and 4 of those carry clear in their attributes, where the store's text search never looks. Chapter 5 tests adding attributes to lexical search. The rest of those curtains say clear nowhere, in their text or their attributes.

The judges had more to go on. WANDS's annotation guidelines show them each product's name, image and web page (guidelines). The photo or the page may be what told them, but that is our guess, because the data doesn't record which evidence a judge used.

Working rule: Treat a judgment as a person's verdict about a need, not a property of the product. Before you blame a ranker for missing an exact product, check whether any field the ranker reads says what the judges saw, and look at the fields it doesn't read, such as attributes. When your judges see more than your ranker does, give the ranker the same evidence where you can, or accept that some exact products will rank low for reasons no change to the ranking can fix.

심사자들이 일부 쌍에서 서로 다르게 판단할 것을 예상한다

마지막으로 변경된 판: 2026.11.8판

두 사람이 서로 다른 판정에 이를 수 있다. WANDS의 각 레이블은 이미 최대 세 명의 주석자가 낸 다수결 결과이며(Chen et al., 2022, section 5), 처음에는 보통 수준의 일치도를 보이던 주석자들은 훈련을 거치며 수렴했다. 우연에 의한 일치를 보정하는 코헨의 카파(Cohen's kappa)는 처음 두 달에는 0.467이었고 셋째 달에는 0.664, 넷째 달에는 0.826으로 올랐다(Table 2). 4장에서 카파를 계산한다.

WANDS 파일에는 이 상점의 일부 쌍이 두 번 이상 나오며, 각 행은 하나의 다수결 결과이고 몇몇 쌍에서는 투표 결과가 서로 다르다. 상점의 표본은 쌍마다 한 행만 남기고, 정확 일치는 2, 부분 일치는 1, 무관은 0으로 등급을 매기며, 행이 서로 다르면 더 낮은 등급을 남긴다(상점 데이터 불러오기). 행이 서로 다른 쌍과 표본에 남은 등급은 다음과 같다.

conflicting-judgments.py Python 3.12.15 · numpy 2.5.5 · pandas 3.1.1 통과
"""Lists the pairs WANDS labelled two ways, with the label the sample kept, and counts the conflicts by kind. Theprose's point rests on the `conflicts between neighbouring grades` line."""import pandas as pdfrom lib.store import DATA, load_labels, load_products, load_queriesGRADES = {"exact": 2, "partial": 1, "irrelevant": 0}products, queries, labels = load_products(), load_queries(), load_labels()conflicts = pd.read_csv(DATA / "label_conflicts.csv")       # pairs WANDS lists more than once, with different labels# the sample's kept label for each pair, which is the lower grade wherever WANDS's rows differkept = labels.set_index(["query_id", "product_id"])["label"]for row in conflicts.itertuples():    print(f"{queries.at[row.query_id, 'query']:<32} {products.at[row.product_id, 'name'][:40]:<41} "          f"{row.labels:<19} kept: {kept[(row.query_id, row.product_id)]}")# each conflicting pair's two labels, from the column where "|" separates thempairs = conflicts["labels"].str.split("|")# a spread of 1 means neighbouring grades: exact and partial, or partial and irrelevantspread = pairs.apply(lambda both: max(GRADES[label] for label in both) - min(GRADES[label] for label in both))print()print("pairs with conflicting labels:", len(conflicts))# frozensets ignore which of the two labels comes firstprint("exact against partial:", (pairs.apply(frozenset) == frozenset(["exact", "partial"])).sum())print("partial against irrelevant:", (pairs.apply(frozenset) == frozenset(["partial", "irrelevant"])).sum())print(f"conflicts between neighbouring grades: {(spread == 1).sum()} of {len(conflicts)}")
출력python conflicting-judgments.py
whimsical solar lights           solar powered led pathway light pack      exact|partial       kept: partial
indoor multi tiered plant stand  taranto multi-tiered plant stand          exact|partial       kept: partial
clear shower curtain             shower curtain hooks                      irrelevant|partial  kept: irrelevant
breakfast bar table              counter height dining table               exact|partial       kept: partial
wood floor protector mat         hard floor straight rectangular chair ma  exact|partial       kept: partial
malachi sled                     sled coffee table                         irrelevant|partial  kept: irrelevant
kohler purist brushed bronze     purist widespread bathroom faucet with d  exact|partial       kept: partial

pairs with conflicting labels: 7
exact against partial: 5
partial against irrelevant: 2
conflicts between neighbouring grades: 7 of 7

판정된 쌍 중 7에서 충돌이 있으며, 그중 5은 정확 일치와 부분 일치 사이의 충돌이고 2은 부분 일치와 무관 사이의 충돌이다. 모든 충돌은 이웃한 등급 사이에 있다(7 of 7). 따라서 약한 지점은 정확 일치와 무관 사이의 간극이 아니라 두 등급 사이의 경계선이다. breakfast bar table 행이 그런 사례의 하나이다. 카운터 높이 식탁이 그 질의에 완전히 부합하는지는 수식어에 관한 타당한 물음이며, 한 표가 과제를 잘못 이해했다는 신호가 아니다.

작업 규칙: 쌍마다 하나의 등급만 남기고, 그것을 고른 규칙을 기록해 둔다. 표본처럼 더 낮은 등급을 권한다. 이 방식은 해당 상품의 순위를 매기는 랭커에게 불리한 쪽으로 오차를 둔다. 심사자들이 정확 일치와 무관처럼 두 등급에 걸쳐 의견이 갈리면, 그들이 정의를 공유하지 않는 것이므로 함께 지침을 다시 읽는다.

이 부분은 아직 번역되지 않았으므로 영어로 표시된다.

마지막으로 변경된 판: 2026.11.10판

Every judgment starts from a reading of what the query asks for. A shopper's intent is what they want to do. A widely cited taxonomy of web search sorts intent into navigational (reach a particular site), informational (find information) and transactional (do something on the web), and its author makes no assumption that intent can be inferred from the query with any certainty (Broder, 2002). Product search reshapes those kinds. Tsagkias et al. describe navigational product queries as ones that name a serial number or a product, and informational ones as usually mapping to a leaf in the inventory taxonomy or asking about specific attributes. They add that "there is no single taxonomy for eCommerce customer intent", because it depends on the store's business and inventory (Tsagkias et al., 2020, section 2).

WANDS writes intent into its labels. A query names a target entity, the kind of product, and the query's modifiers are the attributes the shopper asked for. Exact satisfies both. Partial matches only the target entity and fails the modifiers (Chen et al., 2022, section 3.2). The guidelines' worked example is a query for a kids' chair: a product that is a chair but not for kids is partial (guidelines). Even with that rule, a broad query can be hard to judge. The authors' own example is a shopper who wants an induction cooktop and types cooktop (section 1).

The store's queries cover the range. ines shag rug w003096809 and kohler whitehaven farmhouse kitchen sink name a product line or a model, which makes them navigational. outdoor light fixtures names a category. clear shower curtain and 48 inch kitchen hood add a modifier to an entity. The store's queries also carry query_class, WANDS's predicted class for each query (Table 1). It is a guess at the entity, says nothing about modifiers, and isn't a judgment. Check how often it agrees with the products the judges called exact:

predicted-class-check.py Python 3.12.15 · numpy 2.5.5 · pandas 3.1.1 통과
"""For each query, measures how many of its exact products carry the predicted class, and lists the queries where nonedoes. The prose's point rests on the `queries where most exact products have the query_class` line and the`queries where no exact product has the query_class` line."""import pandas as pdfrom lib.store import load_labels, load_products, load_queriesproducts, queries, labels = load_products(), load_queries(), load_labels()exact = labels[labels["label"] == "exact"].join(products["product_class"], on="product_id")rows = []for query_id, group in exact.groupby("query_id"):    predicted = queries.at[query_id, "query_class"]    classes = group["product_class"].str.split("|")                 # a product can have several classes    # the commonest product_class value, which can join several classes, comes first in value_counts(); a missing class is an empty string, which prints as (none)    rows.append({"query": queries.at[query_id, "query"], "query_class": predicted,                 "share of exact products in it": classes.apply(lambda names: predicted in names).mean(),                 "commonest class of exact products": group["product_class"].value_counts().index[0] or "(none)"})check = pd.DataFrame(rows)print("queries:", len(check))print("queries without a query_class:", check["query_class"].isna().sum())# most means more than half of a query's exact products carry the predicted classprint("queries where most exact products have the query_class:",      (check["share of exact products in it"] > 0.5).sum())missed = check[(check["share of exact products in it"] == 0) & check["query_class"].notna()]print("queries where no exact product has the query_class:", len(missed))print()print(missed.drop(columns="share of exact products in it").to_string(index=False))
출력python predicted-class-check.py
queries: 80
queries without a query_class: 1
queries where most exact products have the query_class: 63
queries where no exact product has the query_class: 6

                   query               query_class commonest class of exact products
foutains with brick look                 Wallpaper                         Fountains
  70s inspired furniture                  Wall Art                            (none)
         7qt slow cooker Crock Pots & Slow Cookers                      Slow Cookers
 sheffield home bath set          Bath Rugs & Mats                          Vanities
      luau string lights             String Lights                  Holiday Lighting
             rustic twig     Faux Plants and Trees             Wall & Accent Mirrors

The predicted class usually agrees with the exact products. For 63 of the 80 queries, most exact products carry it, and for 6 queries, none does, and 1 query has no class at all. Read each row the example prints before counting it as an error. foutains with brick look is classed as Wallpaper, while its exact products are fountains, so the classifier went wrong. 7qt slow cooker is a naming mismatch instead: the query classes and the product classes use different names for the same thing.

Working rule: Read each query as an entity plus modifiers, and check that your ranker gets the entity right before you tune it for modifiers. Use query_class as a hint, for a feature or a filter you check against the judgments, and never as a label. When intent is ambiguous, as with cooktop, judge against the guidelines' reading and write that reading down.

예, 아니요 대신 관련도의 등급을 매긴다

마지막으로 변경된 판: 2026.11.8판

이진 레이블은 관련이 있는지 없는지만 말해 준다. WANDS의 exact, partial, irrelevant처럼 등급을 둔 레이블은 얼마나 관련이 있는지를 말해 준다. 결과마다 유용한 정도가 다르므로, 가장 관련도가 높은 결과를 찾아 가장 앞에 올려야 한다. Järvelin과 Kekäläinen은 2002년에 등급을 써야 한다고 주장했다. 상점에서는 아깝게 빗나간 결과가 차선책으로 충분한 경우가 많다. 투명하지 않은 샤워 커튼은 요청받은 속성이 없을 뿐 알맞은 종류의 상품이므로 WANDS는 이를 partial로 판정하며(상품과 그 수식어로 의도를 읽는다), 이런 커튼은 샤워 커튼 고리보다 쇼핑객이 원한 것에 더 가깝다. 이진 레이블은 등급 사이에 선 하나를 억지로 긋는다. exact만 관련 있는 것으로 세면 아깝게 빗나간 결과는 고리와 똑같이 가치가 낮아진다. exact와 partial을 함께 세면 투명 커튼과 똑같은 가치가 된다.

상점의 질의 clear shower curtain는 두 가지 실패를 모두 보여 준다. 이 질의의 판정으로 상위 10개 순위 세 가지를 만든다. exact 상품 10개, partial로 판정된 샤워 커튼 10개, irrelevant로 판정된 샤워 커튼 고리 10개이다. 그런 다음 각 순위를 세 가지 레이블 방식으로 nDCG@10(순위 하나의 점수 계산)으로 채점한다. 첫째는 exact만 관련 있는 것으로 보는 이진 방식, 둘째는 exact 또는 partial을 관련 있는 것으로 보는 이진 방식, 셋째는 exact에 2, partial에 1, irrelevant에 0을 이득으로 쓰는 이 책의 등급 방식이다. 이득(gain)은 특정 위치의 결과가 위치 할인을 적용하기 전에 점수에 더하는 값이다.

binary-labels-hide-partial.py Python 3.12.15 · numpy 2.5.5 · pandas 3.1.1 통과
"""Scores three rankings of one query's judged products under three labelings, to show what each labeling counts asrelevant. The prose's point rests on the `grades` lines, since only the grades separate the three rankings."""from lib.metrics import ndcg_at_kfrom lib.store import load_products, qrelsclasses = load_products()["product_class"]judgments = qrels()[246]                                     # clear shower curtain: {product_id: grade}def first_ten(grade, product_class=None):    """Ten products judged with this grade for the query, in product_id order."""    # sorted(judgments) takes product_id order as the tie-break; None for product_class means any class    return [product_id for product_id in sorted(judgments) if judgments[product_id] == grade            and product_class in (None, classes[product_id])][:10]rankings = {"clear curtains": first_ten(2),                                   # exact            "other curtains": first_ten(1, "Shower Curtains"),               # partial: not clear            "hooks": first_ten(0, "Shower Curtain Hooks and Accessories")}   # irrelevantlabelings = {"exact only": {2: 1, 1: 0, 0: 0},              # binary: relevant means exact             "exact or partial": {2: 1, 1: 1, 0: 0},        # binary: relevant means exact or partial             "grades": {2: 2, 1: 1, 0: 0}}                  # graded: the book's grades as gainsprint("exact products for this query:", sum(grade == 2 for grade in judgments.values()))# the ideal top 10 holds the ten highest grades, so counting the 2s counts the exact products in itprint("exact products in the ideal top 10:", sorted(judgments.values(), reverse=True)[:10].count(2))for labeling, gain in labelings.items():    gains = {product_id: gain[grade] for product_id, grade in judgments.items()}    for name, ranking in rankings.items():        print(f"{name}, {labeling}: {ndcg_at_k(ranking, gains, 10):.3f}")
출력python binary-labels-hide-partial.py
exact products for this query: 12
exact products in the ideal top 10: 10
clear curtains, exact only: 1.000
other curtains, exact only: 0.000
hooks, exact only: 0.000
clear curtains, exact or partial: 1.000
other curtains, exact or partial: 1.000
hooks, exact or partial: 0.000
clear curtains, grades: 1.000
other curtains, grades: 0.500
hooks, grades: 0.000

세 순위를 구분하는 것은 등급뿐이다. exact만 인정하는 레이블에서는 다른 커튼이 고리와 같은 점수인 0.000과 0.000을 받는다. exact 또는 partial을 인정하는 레이블에서는 다른 커튼이 1.000을 받아 1.000인 투명 커튼과 같아진다. 등급을 쓰면 투명 커튼은 1.000, 다른 커튼은 0.500, 고리는 0.000을 받는다. 여기서처럼 이상적인 상위 10개가 모두 exact이고 그 안에 exact 상품이 10개 들어 있으면, partial 상품 10개로 이루어진 순위의 점수는 exact 이득에 대한 partial 이득의 비율이 된다.

작업 규칙: 상품 검색에는 등급 판정을 권장한다. 그래야 지표가 아깝게 빗나간 결과를 일치로 착각하지 않으면서 그 가치를 인정할 수 있다. 이진 지표도 함께 보고하더라도 등급은 수집해 두어야 한다. 등급은 언제든 예와 아니요로 합칠 수 있지만, 그 반대는 불가능하다. 질의가 모델 번호여서 해당 모델만 쓸모가 있는 경우처럼, 아깝게 빗나간 결과가 사용자에게 아무 가치가 없을 때는 이진 레이블을 쓴다.

이득값을 의도적으로 선택한다

마지막으로 변경된 판: 2026.11.8판

등급은 레이블이다. 이득값은 지표에서 각 레이블이 갖는 가치이며, 이는 선택의 문제다. 이 책은 각 등급을 그대로 이득값으로 사용하므로 부분 일치는 정확 일치의 절반 가치를 갖는다. WANDS 논문도 정확 일치, 부분 일치, 무관을 1.0, 0.5, 0으로 가중한다(Chen et al., 2022, Table 3). 비율이 같으므로 nDCG도 같다. ESCI라고 알려진 Shopping Queries Dataset(Reddy et al., 2022)은 13만 개의 고유 질의에 대해 사람이 직접 레이블을 붙인 질의-상품 판정 260만 건을 담고 있으며, 등급을 다르게 매긴다. 이 데이터셋은 대체재, 즉 스웨터 질의에 대한 플리스처럼 기능적으로 대체할 수 있는 상품과, 보완재, 즉 정확 일치 상품과 함께 쓸 수 있는 상품을 구분한다. 이득값은 정확 일치 1.0, 대체재 0.1, 보완재 0.01, 무관 0.0이다(Reddy et al., 2022, section 3.1). WANDS의 부분 일치는 ESCI의 대체재와 같지 않지만, 가장 가까운 대응물이다.

1장에서 구한 상점의 테스트 실행 두 가지, 즉 모든 테스트 질의에 대한 BM25의 순위와 의미 기반 검색의 순위를 다음 각 방식으로 채점한다. 관련도를 예·아니오 대신 등급으로 매기기의 이진 레이블 두 가지, 이 책의 등급, 그리고 ESCI의 취지를 따른 부분 이득값 0.1이다. 이 예제는 각 방식에서 의미 기반 검색의 우위에 대해 3장의 순열 검정과 대응 t-검정도 실행하고 두 p-값을 출력한다. 이 책의 다른 모든 검정과 마찬가지로 두 우위 모두 기술적 결과다. 의미 기반 실행은 공개 모델 Snowflake/snowflake-arctic-embed-m-v1.5의 기록된 임베딩을 읽는다(의미로 검색하기).

gain-choice-changes-ndcg.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pandas 3.1.1 · scipy 1.18.1 통과
"""Scores BM25 and semantic retrieval on the test queries under four gain schemes, with exploratory paired tests onsemantic retrieval's lead. The prose's point rests on the `semantic minus bm25` lines, which keep one sign across theschemes while their size changes."""from lib.lexical import LexicalSearchfrom lib.metrics import evaluatefrom lib.semantic import SemanticSearchfrom lib.significance import comparefrom lib.store import load_products, load_queries, qrelsqueries, judgments = load_queries("test"), qrels("test")# each run keeps the top 100 products per query; the scores below read only the top 10 of eachruns = {"bm25": LexicalSearch(load_products()).run(queries, k=100), "semantic": SemanticSearch().run(queries, k=100)}for name, run in runs.items():    # an unjudged product gives None here, which the count of 1 does not include    grades = [judgments[query_id].get(product_id) for query_id, ranking in run.items() for product_id in ranking[:10]]    print(f"partial share of the {name} top 10: {grades.count(1) / len(grades):.3f}")# each scheme turns a grade into the gain it is worthschemes = {"exact only": {2: 1, 1: 0, 0: 0},           "exact or partial": {2: 1, 1: 1, 0: 0},           "grades 2, 1, 0": {2: 2, 1: 1, 0: 0},       # the book's choice; WANDS's 1, 0.5, 0 gives the same nDCG           "partial gain 0.1": {2: 1, 1: 0.1, 0: 0}}   # close to the gains ESCI chose for its substitutesleads = 0for scheme, gain in schemes.items():    gains = {query_id: {product_id: gain[grade] for product_id, grade in per_query.items()}             for query_id, per_query in judgments.items()}    scores = {name: evaluate(run, gains)["ndcg@10"] for name, run in runs.items()}    test = compare(scores["semantic"], scores["bm25"])  # exploratory paired tests (chapter 3): no planned comparisons    print(f"bm25, {scheme}: {scores['bm25'].mean():.3f}")    print(f"semantic, {scheme}: {scores['semantic'].mean():.3f}")    print(f"semantic minus bm25, {scheme}: {test['mean difference']:.3f}")    print(f"permutation p, {scheme}: {test['permutation p']:.3f}")    print(f"t-test p, {scheme}: {test['t-test p']:.3f}")    print(f"tied queries, {scheme}: {test['ties']}")    # a lead is a positive mean difference, semantic minus BM25    leads += test["mean difference"] > 0print(f"schemes where semantic leads: {leads} of {len(schemes)}")
출력python gain-choice-changes-ndcg.py
partial share of the bm25 top 10: 0.403
partial share of the semantic top 10: 0.380
bm25, exact only: 0.519
semantic, exact only: 0.648
semantic minus bm25, exact only: 0.130
permutation p, exact only: 0.000
t-test p, exact only: 0.002
tied queries, exact only: 3
bm25, exact or partial: 0.903
semantic, exact or partial: 0.983
semantic minus bm25, exact or partial: 0.080
permutation p, exact or partial: 0.010
t-test p, exact or partial: 0.026
tied queries, exact or partial: 19
bm25, grades 2, 1, 0: 0.725
semantic, grades 2, 1, 0: 0.830
semantic minus bm25, grades 2, 1, 0: 0.105
permutation p, grades 2, 1, 0: 0.001
t-test p, grades 2, 1, 0: 0.003
tied queries, grades 2, 1, 0: 2
bm25, partial gain 0.1: 0.564
semantic, partial gain 0.1: 0.688
semantic minus bm25, partial gain 0.1: 0.125
permutation p, partial gain 0.1: 0.000
t-test p, partial gain 0.1: 0.002
tied queries, partial gain 0.1: 2
schemes where semantic leads: 4 of 4

의미 기반 검색은 4 of 4개 방식에서 앞서지만, 우위의 크기는 선택에 따라 달라진다. 부분 일치 상품은 BM25의 상위 10개 자리 중 0.403를, 의미 기반 검색의 상위 10개 자리 중 0.380를 차지하므로, 부분 이득값은 두 점수를 크게 움직인다. BM25는 정확 일치만 레이블로 쓰면 0.519, 정확 또는 부분 일치를 레이블로 쓰면 0.903를 얻는다. ESCI와 비슷한 부분 이득값 0.1에서는 BM25가 0.564, 의미 기반 검색이 0.688를 얻는다. 우위는 정확 일치만 쓸 때 0.130, ESCI와 비슷한 이득값에서 0.125, 등급에서 0.105, 정확 또는 부분 일치 레이블에서 0.080이다. 예제는 이 우위들이 서로 다른지 검정하지 않으므로, 테스트 질의가 30개인 상황에서 이들 사이의 차이는 잡음일 수 있다고 본다.

정확 또는 부분 일치 레이블도 포화되어, 더 적은 수의 질의에서만 순위기를 구분한다. 이 레이블에서는 테스트 질의 19개가 동점이고, 등급에서는 2개가 동점이다.

작업 규칙: 상품 검색의 기본값으로는 등급 2, 1, 0의 선형 이득값을 사용한다. 아깝게 빗나간 결과가 구매자에게 별로 가치가 없다면 더 낮은 부분 이득값을 선택한다. 무엇을 선택하든 순위기를 비교하기 전에 고정하고, 모든 점수와 함께 보고하며, 서로 다른 이득값으로 계산한 nDCG는 절대 비교하지 않는다.

쿼리별 레이블 구성 읽기

마지막으로 변경된 판: 2026.11.8판

게인은 각 등급의 가치를 정하지만, 쿼리마다 각 등급이 몇 개씩 있는지는 알려 주지 않는다. 판정 집합은 하나의 균질한 모집단이 아니다. 쿼리마다 판정된 상품의 풀이 따로 있고 등급의 구성도 다르며, 이 구성이 해당 쿼리에서 완벽한 랭킹이 어떤 모습인지를 결정한다. 많은 상품이 만족하는 카테고리를 가리키는 넓은 쿼리에는 정확히 일치하는 상품이 많다. 수식어가 여럿 붙은 구체적인 쿼리에는 그런 상품이 몇 개뿐일 수도 있다. 쿼리 전체에 대한 평균은 이처럼 서로 다른 문제를 뒤섞으므로, 무엇이든 평균을 내기 전에 구성부터 읽어야 한다.

스토어의 쿼리는 WANDS에서 무작위로 뽑은 표본이 아니다. 각 쿼리는 판정된 상품이 60개에서 300개 사이이고, 정확 판정이 3개 이상, 부분 판정이 20개 이상이며, 예측 클래스가 다른 어떤 선택된 쿼리와도 겹치지 않도록 골랐다(데이터 카드). 한계 밖의 쿼리는 스토어에 들어오지 않으므로, 이 수치는 WANDS 전체가 아니라 표본을 설명한다. 80개 쿼리 각각의 레이블을 세고, 정확 상품의 비율에 따라 쿼리를 묶어 보자.

count-labels-per-query.py Python 3.12.15 · numpy 2.5.5 · pandas 3.1.1 통과
"""Counts each query's judgments by label, and groups the queries by their share of exact products. The prose's pointrests on the `queries with an exact share of 0.1 or less` line and on the histogram below it."""import pandas as pdfrom lib.store import load_labels, load_queriesqueries, labels = load_queries(), load_labels()counts = pd.crosstab(labels["query_id"], labels["label"])[["exact", "partial", "irrelevant"]]shares = counts.div(counts.sum(axis=1), axis=0).join(queries[["query", "split"]])print(f"partial share of all judgments: {(labels['label'] == 'partial').mean():.3f}")print(f"median exact share: {shares['exact'].median():.3f}")print(f"median irrelevant share: {shares['irrelevant'].median():.3f}")for label, which in [("exact", "lowest"), ("exact", "highest"), ("irrelevant", "highest")]:    query_id = shares[label].idxmin() if which == "lowest" else shares[label].idxmax()    print(f"{which} {label} share: {shares.at[query_id, label]:.3f}")    print(f"query with the {which} {label} share: {shares.at[query_id, 'query']}")print("queries with no irrelevant judgment:", (counts["irrelevant"] == 0).sum())print("fewest exact products for a query:", counts["exact"].min())print("most exact products for a query:", counts["exact"].max())# 10 is the size of a top 10: a query with fewer exact products can't fill a perfect top 10 with exact onesfew = counts["exact"] < 10print("queries with fewer than 10 exact products:", few.sum())print("test queries with fewer than 10 exact products:", (few & (shares["split"] == "test")).sum())print("queries with an exact share of 0.1 or less:", (shares["exact"] <= 0.1).sum())print()print("exact share  queries")bins = pd.cut(shares["exact"], [tenth / 10 for tenth in range(11)])     # no share is 0: each query has 3 or more exactfor interval, number in bins.value_counts(sort=False).items():    print(f"{interval.left:.1f} to {interval.right:.1f}  {number:>3}  {'#' * number}".rstrip())
출력python count-labels-per-query.py
partial share of all judgments: 0.610
median exact share: 0.207
median irrelevant share: 0.060
lowest exact share: 0.014
query with the lowest exact share: 48 in entry table with side by side drawer
highest exact share: 0.749
query with the highest exact share: outdoor light fixtures
highest irrelevant share: 0.776
query with the highest irrelevant share: podium with locking cabinet
queries with no irrelevant judgment: 9
fewest exact products for a query: 3
most exact products for a query: 193
queries with fewer than 10 exact products: 23
test queries with fewer than 10 exact products: 7
queries with an exact share of 0.1 or less: 29

exact share  queries
0.0 to 0.1   29  #############################
0.1 to 0.2   10  ##########
0.2 to 0.3   12  ############
0.3 to 0.4   11  ###########
0.4 to 0.5    9  #########
0.5 to 0.6    1  #
0.6 to 0.7    7  #######
0.7 to 0.8    1  #
0.8 to 0.9    0
0.9 to 1.0    0

부분 일치가 가장 흔한 레이블이며 전체 판정의 0.610를 차지한다. 그 이유는 WANDS가 후보를 모은 방식에 있을 가능성이 크며, 이는 판정이 어디서 왔는지 알기에서 다룬다. 정확 일치의 비율은 쿼리마다 크게 달라, 48 in entry table with side by side drawer의 0.014에서 outdoor light fixtures의 0.749까지 이르며 중앙값은 0.207이다. 예제가 출력하는 히스토그램은 낮은 구간이 가장 높다. 정확 일치 비율이 0.1 이하인 쿼리가 29개다.

관련 없음 판정은 대부분의 쿼리에서 드물지만 모든 쿼리에서 그런 것은 아니다. 관련 없음 비율의 중앙값은 0.060이지만 podium with locking cabinet에서는 0.776에 이르고, 관련 없음 판정이 전혀 없는 쿼리는 9개다.

이러한 분산은 nDCG@10이 측정하는 바를 바꾼다. 쿼리당 정확 상품 수는 샘플링 규칙의 하한인 3개에서 193개까지 이르며, 정확 상품이 10개 미만인 쿼리가 23개이고 그중 7개가 테스트 쿼리다. 이런 쿼리에서는 이상적인 상위 10개에 부분 일치 상품이 포함되므로, 상위 10개에 부분 일치 상품이 있어도 랭킹이 만점을 받을 수 있다. outdoor light fixtures와 같은 넓은 쿼리에서는 만점을 받으려면 정확 상품 10개가 필요하다. 같은 nDCG@10이라도 쿼리마다 의미가 다르다.

작업 규칙: 어떤 지표든 평균을 내기 전에 쿼리별 레이블 구성을 출력하고, 양쪽 끝을 모두 살펴라. 정확 상품이 적은 쿼리의 낮은 점수는 넓은 쿼리의 낮은 점수와 다른 문제로 읽어라. 모든 평균 옆에는 쿼리별 점수를 함께 두어라. 평균이 무엇을 가리는지는 3장에서 보인다.

클릭을 편향된 증거로 다룬다

마지막으로 변경된 판: 2026.11.10판

상점은 모든 클릭을 기록하고, 클릭은 수집하는 데 비용이 들지 않으므로 공짜 판단처럼 보인다. 그렇지 않다. 클릭은 구매자가 그 상품을 살펴보기로 선택했다는 사실만 말해 준다. 그 상품이 필요를 충족했다는 뜻은 아니며, 구매자가 클릭하느냐 자체가 상품이 어디에 어떻게 보였는지에 달려 있다.

클릭이 어떻게 오도하는지에 대한 증거는 웹 검색에서 나왔다. Joachims 등은 코넬 대학교 학부생들이 Google로 정해진 질문 열 개에 답하는 동안 시선과 클릭을 추적했다. 실험은 두 단계로 진행되었고, 첫 단계에는 학생 34명이, 두 번째 단계에는 22명이 참여했다. 두 번째 단계에서는 일부 학생이 상위 두 결과의 순서가 바뀌거나 목록 전체가 뒤집힌 화면을 보았다(Joachims et al., 2005). 이들은 클릭이 "정보를 담고 있지만 편향되어 있다"고 결론지었다.

첫 번째 편향은 위치 편향이다. 사람들은 순위가 높은 결과를 더 많이 클릭하는데, 이는 부분적으로 순위를 신뢰하기 때문이다. Joachims 등은 이 효과를 "신뢰 편향"이라 부른다. 이 편향은 사용자가 본 다른 요약문이 더 관련성이 높은 경우에도 높은 순위의 링크로 클릭을 끌어당긴다. 저자들은 또한 건너뛴 결과보다 클릭한 결과를 선호하는 식의 상대적 선호는 평균적으로 상당히 정확하다는 점도 발견했다.

Craswell 등은 웹 검색 엔진에서 수행한 대규모 실험에서, 상위 순위의 위치 편향을 캐스케이드 모델이 가장 잘 설명한다는 것을 발견했다. 캐스케이드 모델에서 사용자는 결과를 위에서 아래로 읽다가 처음으로 쓸 만한 문서를 만나면 떠난다(Craswell et al., 2008).

표시 편향은 위치를 넘어선다. 클릭은 결과가 어디에 보이는지만이 아니라 어떻게 보이는지에도 좌우된다. Google 웹 검색 트래픽의 일부에서, 더 매력적인 제목, 즉 질의의 단어가 굵게 더 많이 표시된 제목을 가진 결과는 위치와 사람이 판단한 관련성을 통제한 뒤에도 더 많은 클릭을 끌어냈다(Yue et al., 2010). 상점에서는 이미지와 가격이 제목에 가장 가까운 대응물이다. 이것은 측정된 결과가 아니라 우리의 추론이다.

WANDS에는 클릭 데이터가 없으므로 상점은 이런 편향을 측정할 수 없다. 그래도 클릭 로그가 무엇을 기록할지는 볼 수 있다. clear shower curtain에 대한 상점의 판단을 가져와 캐스케이드 모델을 가장 엄격한 형태로 적용한다. 구매자는 맨 위에서부터 읽고, 처음 나오는 정확한 상품을 클릭한 뒤 떠난다. 이 사고 실험은 실제 구매자의 모델이 아니라 고정된 규칙 하나를 사용한다. 11장에서는 확률로 클릭을 시뮬레이션한다. BM25의 순위와 시맨틱 검색의 순위에 이 사고 실험을 실행하고, 두 클릭 로그를 나란히 읽어 보자.

cascade-clicks.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pandas 3.1.1 · scipy 1.18.1 통과
"""Reads the top 10 of BM25 and of semantic retrieval for `clear shower curtain` as a cascade of clicks, which stops atthe first exact product. The prose's point rests on the `clicked rank` lines and on the `exact products shown below theclick` lines."""from lib.lexical import LexicalSearchfrom lib.semantic import SemanticSearchfrom lib.store import load_products, qrelsproducts = load_products()judgments = qrels()[246]                                     # clear shower curtain: {product_id: grade}# search returns scores indexed by product_id, so .index is the ranking; semantic search takes the query's id, 246rankings = {"bm25": list(LexicalSearch(products).search("clear shower curtain", k=10).index),            "semantic": list(SemanticSearch().search(246, k=10).index)}for name, ranking in rankings.items():    grades = [judgments.get(product_id, 0) for product_id in ranking]     # an unjudged product counts as grade 0    rank = grades.index(2) + 1             # cascade: read from the top, click the first exact product, stop    print(f"{name} grades, ranks 1 to 10: {' '.join(map(str, grades))}")    print(f"{name} clicked rank: {rank}")    # rank counts from 1 and the list from 0, so the clicked product sits at index rank - 1    print(f"{name} clicked product: {products.at[ranking[rank - 1], 'name']}")    # grades[rank:] starts just after the click, since rank is the clicked product's position counted from 1    print(f"{name} exact products shown below the click: {grades[rank:].count(2)}")
출력python cascade-clicks.py
bm25 grades, ranks 1 to 10: 1 2 2 2 2 1 1 0 0 0
bm25 clicked rank: 2
bm25 clicked product: woolley vinyl single shower curtain
bm25 exact products shown below the click: 3
semantic grades, ranks 1 to 10: 2 2 1 1 2 1 2 2 1 1
semantic clicked rank: 1
semantic clicked product: woolley vinyl solid color single shower curtain
semantic exact products shown below the click: 4

클릭 로그는 구매자가 원한 것만큼이나 순위 알고리즘이 먼저 보여 준 것을 기록한다. BM25의 순위에서는 구매자가 2위의 woolley vinyl single shower curtain을(를) 클릭하고, 그 아래에 있는 정확한 상품 3개에는 도달하지 못한다. 클릭 로그에서 이 정확한 상품들은 BM25의 8~10위, 즉 관련 없음으로 판단된 샤워 커튼 고리(BM25로 상품 순위 매기기)와 똑같아 보이는데, 그 고리도 아무도 클릭하지 않았기 때문이다.

시맨틱 검색의 순위에서는 클릭이 1위, 즉 woolley vinyl solid color single shower curtain에 떨어진다. 같은 카탈로그에서 나온 두 순위가 서로 다른 상품에 공을 돌리는 두 클릭 로그를 만들어 낸다.

WANDS의 저자들도 같은 이유인 위치 편향 때문에 로그로 데이터셋을 만들지 않았다고 밝힌다(판단과 결과 대조하기). 그렇더라도 클릭에는 정보가 담겨 있다. WANDS에서 클릭 로그에서 가져온 후보의 62.47%가 정확으로 판단되었는데, 오픈소스 순위 시스템에서 가져온 후보는 30.95%였다(Chen et al., 2022, Table 4).

클릭의 편향을 보정하는 일은 편향 없는 랭킹 학습이라는 독자적인 분야다. Baidu가 공개한 대규모 검색 데이터셋에서 이런 방법들은 클릭 예측을 개선했지만, 전문가가 판단한 기준의 "랭킹 성능은 일관되게 개선하지 못했다"(Hager et al., 2024).

작업 규칙: 오프라인 평가의 기준으로는 클릭이 아니라 판단을 사용한다. 클릭은 상대적 증거, 즉 위에 순위가 매겨진 건너뛴 상품보다 클릭한 상품을 선호한다는 정도로만 사용하고, 클릭이 없다는 사실을 상품이 관련 없다는 신호로 읽어서는 안 된다. 클릭으로 학습한다면 결과를 판단과 대조해 확인한다.

판단이 어디에서 왔는지 파악하라

마지막으로 변경된 판: 2026.11.10판

모든 질의에 대해 모든 상품을 판단하는 사람은 없으므로, 테스트 컬렉션은 대신 풀(pool), 즉 질의마다 모은 후보 집합을 판단한다. TREC(Text REtrieval Conference)의 공동 평가에서 한 주제의 풀은 각 참가자가 검색한 상위 문서, 보통 상위 100개를 합집합으로 모은 것이며, 풀 밖의 모든 문서는 관련 없는 것으로 간주한다. Voorhees는 풀에 관련 문서가 충분히 들어 있으므로, 판단되지 않은 문서를 모두 관련 없는 것으로 간주해도 시스템을 공정하게 비교할 수 있다고 주장한다. 같은 글은 풀링으로는 임의로 큰 문서 집합에 대해 재사용 가능한 테스트 컬렉션을 만들 수 없다고도 지적한다(Voorhees, 2007). Zobel은 이 공정성 주장을 검증했다. 풀링된 판단으로 보면 시스템의 상대적 성능은 신뢰할 만해 보이지만, 관련 문서 중 상당수가 아직 발견되지 않았을 가능성이 높아 재현율은 과대평가된다(Zobel, 1998).

WANDS는 풀을 두 단계로 구축했다(Chen et al., 2022, 4.2절과 4.3절). 첫 번째 단계에서는 쇼핑객이 클릭했거나 장바구니에 담은 상품에, 오픈 소스 어휘 검색 엔진인 Solr와 신경망 검색 시스템의 결과를 더했다. 두 번째 단계에서는 같은 두 시스템으로 전체 카탈로그를 다시 탐색하고, 질의 분류 모델이 해당 질의에 대해 예측한 클래스의 모든 상품을 추가했다. 이 두 번째 단계가 WANDS 레이블의 대부분을 만들어 냈고, 그 대부분은 아슬아슬하게 빗나간 것들이었다. 레이블의 4.12%가 exact였고 63.99%가 partial이었다(Table 5). partial은 이 상점의 표본에서도 가장 흔한 레이블이다(질의별 레이블 구성 읽기). 저자들은 상품 검색에서는 완전성이 중요하다고 주장하며, "incompleteness in Product Search dataset does negatively impact the discriminative power of the evaluation"이라고 쓴다(3.1절).

풀은 질의에 속한다. 어떤 질의에 대해 판단이 없는 상품은 그 질의에 대해 미판단(unjudged) 상품이며, 한 질의에서 판단된 상품이 비슷한 다른 질의에서는 미판단일 수 있다. 이 상점의 두 질의가 이를 보여 준다. 학습 질의 trundle daybed와 테스트 질의 full bed with trundle이다. 첫 번째 질의에서 exact로 판단된 상품 중 두 번째 질의에 대한 판단이 없는 상품의 수를 세고, 판단이 있는 상품은 판단자들이 어떻게 등급을 매겼는지 살펴보자.

trundle-daybeds-unjudged.py Python 3.12.15 · numpy 2.5.5 · pandas 3.1.1 통과
"""Counts the products judged exact for the train query `trundle daybed` that have no judgment for the test query `fullbed with trundle`, and grades the ones that do. The prose's point rests on the `of them unjudged for full bed withtrundle` line and the `judged partial` line."""from collections import Counterfrom lib.store import load_products, load_queries, qrelsproducts, queries, judgments = load_products(), load_queries(), qrels()LABELS = {2: "exact", 1: "partial", 0: "irrelevant"}# 433 is the train query trundle daybed, and its exact products come out in product_id orderdaybeds = sorted(product_id for product_id, grade in judgments[433].items() if grade == 2)full_bed = judgments[436]                                    # {product_id: grade} for "full bed with trundle"print(f"433: {queries.at[433, 'query']} ({queries.at[433, 'split']})")print(f"436: {queries.at[436, 'query']} ({queries.at[436, 'split']})")print("exact for trundle daybed:", len(daybeds))unjudged = [product_id for product_id in daybeds if product_id not in full_bed]print("of them unjudged for full bed with trundle:", len(unjudged))print("of them judged for full bed with trundle:", len(daybeds) - len(unjudged))judged = Counter(LABELS[full_bed[product_id]] for product_id in daybeds if product_id in full_bed)for label in LABELS.values():    print(f"judged {label}: {judged[label]}")# daybeds is in product_id order, so the first two unjudged are the two lowest product_ids among themprint("first unjudged daybed:", products.at[unjudged[0], "name"])print("second unjudged daybed:", products.at[unjudged[1], "name"])
출력python trundle-daybeds-unjudged.py
433: trundle daybed (train)
436: full bed with trundle (test)
exact for trundle daybed: 113
of them unjudged for full bed with trundle: 77
of them judged for full bed with trundle: 36
judged exact: 5
judged partial: 31
judged irrelevant: 0
first unjudged daybed: daybed with trundle
second unjudged daybed: pattonsburg daybed with trundle

미판단 상품에 0점을 주는 지표는 그 상품에 대해 추측하는 것이며, 여기서는 그 추측이 중요하다. 지침의 규칙을 우리가 읽은 바로는, 트런들이 달린 데이베드는 질의가 요구하는 크기는 아니어도 종류는 맞는 침대인 경우가 많다. trundle daybed에 대해 exact로 판단된 113개 상품 중 77개는 full bed with trundle에 대한 판단이 없으며, 그 안에는 상품 번호가 가장 낮은 두 상품 daybed with trundle와 pattonsburg daybed with trundle가 있다. 판단이 있는 36개에 대해서는 판단자들이 5개를 exact, 31개를 partial, 0개를 irrelevant로 판정했다. 미판단 데이베드가 판단된 것들과 비슷하다면 대부분은 역시 partial일 텐데, 지표는 이 상품 각각에 등급 0을 준다.

Zobel은 풀링된 판단이 풀에 기여하지 않은 시스템을 과소평가할 수 있다고 경고한다(Zobel, 1998). 그러면 판단은 풀을 만든 시스템과 비슷한 랭커에 가장 공정하다. WANDS의 경우 그런 시스템은 쇼핑객의 클릭, 어휘 검색 엔진, 신경망 검색기, 질의 분류기이다. 이는 법칙이 아니라 경향이다. 여기서는 WANDS의 어휘 검색 엔진과 가장 비슷한 랭커인 BM25가 두 랭커 중 judged@10이 더 낮다(미판단 상품 세기). 우리의 추측으로는 이 상점의 BM25가 풀을 만든 엔진과 다른 필드를 읽기 때문에 상위에 올리는 상품이 다르다.

작업 규칙: 비교를 신뢰하기 전에 풀이 어디에서 왔는지 확인하라. 풀을 만든 시스템과 다른 랭커를 평가할 때는 아무도 판단하지 않은 상품이 나타나리라 예상하고, 그 상품들을 판단할 계획을 세워라.

이 부분은 아직 번역되지 않았으므로 영어로 표시된다.

Count unjudged products before you compare scores

마지막으로 변경된 판: 2026.11.10판

A product nobody judged for a query is unjudged: its grade is unknown, not 0. Standard metrics can't tell the difference. They score an unjudged product exactly as they score one judged irrelevant, and Buckley and Voorhees warn that such metrics become unreliable when judgments are very incomplete (Buckley and Voorhees, 2004). Two diagnostics are standard in evaluation tools (ir-measures). Judged@k is the share of the top k that has a judgment of any grade:

judged@k = (number of the top k products that have a judgment for the query) / k

The second diagnostic is the condensed list, a ranking with its unjudged products dropped before scoring, so the judged ones move up. ir-measures offers it as the judged_only option. Buckley and Voorhees's bpref measure works in the same spirit: it uses judged documents only, and they found it more robust to incomplete judgments.

In chapter 1, BM25's mean judged@10 on the test queries is 0.927. The mean for semantic retrieval is 0.990. One property of the store's data keeps those numbers high. Its catalog is almost all judged: 11,917 of 12,000 products have a judgment for at least one query (Load the store's data). Expect a full catalog to put more unjudged products in the top 10s.

Build judged@10 by hand, check it against lib.metrics, and list where BM25's unjudged products are:

unjudged-in-bm25-top-10.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pandas 3.1.1 · scipy 1.18.1 통과
"""Builds judged@10 by hand for BM25's test rankings, checks it against lib.metrics, and lists where BM25's unjudgedproducts sit in the top 10s. The prose's point rests on the `unjudged products in the top 10s` line and on the`irrelevant judgments` line for pull out sleeper loveseat."""import pandas as pdfrom lib.lexical import LexicalSearchfrom lib.metrics import evaluatefrom lib.store import load_products, load_queries, qrelsproducts, queries, judgments = load_products(), load_queries("test"), qrels("test")# 100 products per query are kept; this example reads only the top 10 of eachrun = LexicalSearch(products).run(queries, k=100)def judged_at_k(ranking, judged, k):    """The share of the top k that has a judgment of any grade."""    return sum(product_id in judged for product_id in ranking[:k]) / krows = []for query_id, ranking in run.items():    unjudged = [product_id for product_id in ranking[:10] if product_id not in judgments[query_id]]    # the name is cut to 45 characters so that the table fits on the page    rows.append({"query": queries.at[query_id, "query"], "judged@10": judged_at_k(ranking, judgments[query_id], 10),                 "unjudged": len(unjudged), "first unjudged product": products.at[unjudged[0], "name"][:45] if unjudged else ""})table = pd.DataFrame(rows)print(f"mean judged@10: {table['judged@10'].mean():.3f}")# lib.metrics' judged@10 per query, indexed by query_idlibrary = evaluate(run, judgments)["judged@10"]# 1e-12 allows for floating-point rounding when the two judged@10 values are comparedagree = sum(abs(row["judged@10"] - library[query_id]) < 1e-12 for query_id, row in zip(run, rows))print(f"queries where the hand-built judged@10 equals lib.metrics: {agree} of {len(rows)}")print("unjudged products in the top 10s:", table["unjudged"].sum())print("test queries with an unjudged product in the top 10:", (table["judged@10"] < 1).sum())sleeper = list(judgments[244].values())                      # pull out sleeper loveseatprint("judgments for pull out sleeper loveseat:", len(sleeper))print("irrelevant judgments for pull out sleeper loveseat:", sleeper.count(0))  # grade 0 is irrelevantprint()# judged@10 below 1 means the query has at least one unjudged product in its top 10print(table[table["judged@10"] < 1].sort_values("judged@10").to_string(index=False))
출력python unjudged-in-bm25-top-10.py
mean judged@10: 0.927
queries where the hand-built judged@10 equals lib.metrics: 30 of 30
unjudged products in the top 10s: 22
test queries with an unjudged product in the top 10: 7
judgments for pull out sleeper loveseat: 143
irrelevant judgments for pull out sleeper loveseat: 0

                    query  judged@10  unjudged                        first unjudged product
   outdoor light fixtures        0.2         8  60 watt equivalent e12 led candle light bulb
     beach blue headboard        0.5         5 lemon frosting indoor/outdoor , removable cov
pull out sleeper loveseat        0.6         4    country oxford 87.75 '' rolled arm sleeper
    full bed with trundle        0.8         2 abel staircase twin over full bunk bed with t
   whimsical solar lights        0.9         1 luciole 0.12-watt led solar power dusk to daw
  bistro table and chairs        0.9         1              drayton patio 5 piece bistro set
     wooden chair outdoor        0.9         1 osterley 31.5 '' w writing desk and chair set

The hand-built judged@10 equals lib.metrics on 30 of 30 test queries, with a mean of 0.927. Unjudged products fill 22 of BM25's top-10 places, spread over 7 queries. By our reading, some are plainly irrelevant: light bulbs for outdoor light fixtures, an outdoor pillow for beach blue headboard. Others look like near misses or matches: a bunk bed with a trundle for full bed with trundle, a bistro set for bistro table and chairs, a sleeper sofa for pull out sleeper loveseat, which by the entity-and-modifier rule is probably a near miss: the judges called 0 of that query's 143 judged products irrelevant.

Score both rankers with condensed lists, which drop the unjudged products, to see how far the scores move:

condensed-ndcg.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pandas 3.1.1 · scipy 1.18.1 통과
"""Scores BM25 and semantic retrieval on the test queries with standard and condensed nDCG@10, and runs exploratorytests on the change in the lead. The prose's point rests on the `semantic minus bm25` lines and the `share of bm25'sgain` line."""from lib.lexical import LexicalSearchfrom lib.metrics import evaluatefrom lib.semantic import SemanticSearchfrom lib.significance import comparefrom lib.store import load_products, load_queries, qrelsqueries, judgments = load_queries("test"), qrels("test")runs = {"bm25": LexicalSearch(load_products()).run(queries, k=100), "semantic": SemanticSearch().run(queries, k=100)}standard, condensed = {}, {}for name, run in runs.items():    # condensed: drop every unjudged product, so the judged ones move up into the top 10    judged_only = {query_id: [product_id for product_id in ranking if product_id in judgments[query_id]]                   for query_id, ranking in run.items()}    standard[name] = evaluate(run, judgments)["ndcg@10"]    condensed[name] = evaluate(judged_only, judgments)["ndcg@10"]    print(f"{name} ndcg@10: {standard[name].mean():.3f}")    print(f"{name} condensed ndcg@10: {condensed[name].mean():.3f}")gain = condensed["bm25"] - standard["bm25"]                   # bm25's change, per test query# the scores are indexed by query_id: 133 is outdoor light fixtures, and 46 is beach blue headboardprint(f"bm25 ndcg@10 for outdoor light fixtures: {standard['bm25'][133]:.3f}")print(f"bm25 condensed ndcg@10 for outdoor light fixtures: {condensed['bm25'][133]:.3f}")print(f"share of bm25's gain from outdoor light fixtures and beach blue headboard: {gain[[133, 46]].sum() / gain.sum():.3f}")lead, condensed_lead = standard["semantic"] - standard["bm25"], condensed["semantic"] - condensed["bm25"]change = compare(condensed_lead, lead)                       # is the change in the lead more than noise? (exploratory)print(f"semantic minus bm25: {lead.mean():.3f}")print(f"semantic minus bm25, condensed: {condensed_lead.mean():.3f}")print(f"change in the lead: {change['mean difference']:.3f}")print(f"95% interval for the change: {change['ci low']:.3f} to {change['ci high']:.3f}")print(f"t-test p for the change: {change['t-test p']:.3f}")print(f"permutation p for the change: {change['permutation p']:.3f}")condensed_test = compare(condensed["semantic"], condensed["bm25"])   # the condensed lead itself (exploratory)print(f"t-test p for the condensed lead: {condensed_test['t-test p']:.3f}")print(f"permutation p for the condensed lead: {condensed_test['permutation p']:.3f}")
출력python condensed-ndcg.py
bm25 ndcg@10: 0.725
bm25 condensed ndcg@10: 0.778
semantic ndcg@10: 0.830
semantic condensed ndcg@10: 0.834
bm25 ndcg@10 for outdoor light fixtures: 0.286
bm25 condensed ndcg@10 for outdoor light fixtures: 1.000
share of bm25's gain from outdoor light fixtures and beach blue headboard: 0.612
semantic minus bm25: 0.105
semantic minus bm25, condensed: 0.056
change in the lead: -0.049
95% interval for the change: -0.138 to -0.015
t-test p for the change: 0.073
permutation p for the change: 0.036
t-test p for the condensed lead: 0.011
permutation p for the condensed lead: 0.009

Condensing lifts BM25 mostly by forgiving bad results, not by undoing a penalty on good ones. BM25 goes from 0.725 to 0.778, and semantic retrieval from 0.830 to 0.834. Of BM25's gain, a share of 0.612 comes from outdoor light fixtures and beach blue headboard, the two queries whose unjudged products are plainly irrelevant. For outdoor light fixtures, BM25 goes from 0.286 to 1.000: once the bulbs drop out, the judged lights below them move up.

Semantic retrieval's lead falls from 0.105 to 0.056 once the lists are condensed. Whether that change is more than noise is unsettled. Chapter 3's paired t-test gives p = 0.073 for the change, and its permutation test gives 0.036. The 95% bootstrap interval runs from -0.138 to -0.015. Both checks are exploratory. With the change carried by a few queries, treat it as possibly noise.

The condensed lead itself gets p = 0.009 from the permutation test and 0.011 from the t-test. Neither the standard score nor the condensed one is the truth. The standard score punishes unjudged products that may be good, and the condensed score hides unjudged products that are bad.

Working rule: Report judged@10 next to every nDCG@10, and compute condensed scores as a diagnostic, never as the headline. When two rankers' judged@10 differ, have the unjudged products in their top 10s judged before you compare them. That is the dependable cure, and on this sample it is a small job: 22 judgments for BM25's test run. On a full catalog, expect more.

운영 환경에서 생기는 문제

마지막으로 변경된 판: 2026.11.8판

판단은 시간이 지나면 낡는다. 상점의 카탈로그와 구매자는 계속 변하며, 관련성은 질의만으로 정해지지 않는다. Tsagkias 등은 사용자, 시간, 질의, 맥락을 꼽고 예를 하나 든다. 재킷을 찾는 질의에서 관련 있는 상품은 겨울과 여름에 서로 다르다(Tsagkias et al., 2020, 3.1.1절). 상품은 판단을 받지 않은 채 카탈로그에 들어오고, 카탈로그를 떠난 상품은 판단 집합에 그대로 남는다. 운영 중인 랭커의 judged@10을 시간에 따라 추적하고, 이 값이 떨어지면 판단을 다시 수행한다.

클릭 레이블은 지금의 순위를 그대로 확인해 줄 뿐이다. 현재 순위에서 기록된 클릭으로 학습한 랭커는 구매자의 선호와 함께 그 순위의 순서까지 학습한다. 클릭을 검증할 기준으로는 사람의 판단을 유지한다(클릭을 편향된 증거로 다루기).

지침이 판단의 모양을 정한다. WANDS의 주석자들이 거의 완벽한 일치도에 이르기까지 네 달이 걸렸다(Chen et al., 2022, Table 2). 지침의 작은 선택이 집합 전체의 성격을 정한다. WANDS는 주석자에게 철자 오류를 무시하고 예제를 적힌 그대로 판단하라고 지시했으므로(지침), 그 판단은 ligth bulb을 이해하는 독자를 전제로 한다. 이를 이해하지 못하는 랭커는 이런 질의에서 낮은 점수를 받게 되며, 이는 구매자 입장에서 타당한 결과다. 8장에서는 철자 교정기를 만들고, 그 교정기가 여전히 틀리는 부분을 보인다.

랭커는 판단자보다 적게 본다. 판단자는 이미지와 상품 페이지를 보았지만, 상점의 랭커는 속성이 빠진 텍스트를 읽는다(5장에서 속성을 추가해 시험한다). 같은 텍스트만 보고 판단하도록 요청받은 대규모 언어 모델(LLM)도 랭커가 보는 것만 본다. 이런 시스템과 사람의 판단 사이에 나타나는 불일치의 일부는 시스템이 아니라 이 정보 차이에서 나온다. 랭커를 탓하기 전에, 판단자가 높이 평가한 속성이 어느 필드에 들어 있는지 확인한다.

모델로 빈틈을 메우는 데에도 사람의 판단이 필요하다. Gienapp 등은 질의마다 그 질의에 대한 사람의 판단으로 작은 분류기를 미세 조정하고, 이를 사용해 판단받지 않은 상품을 판단한다. 이들은 TREC Robust04와 2019년, 2020년 TREC Deep Learning 컬렉션에서 주제당 초기 사람 판단이 128개만 있어도 모델 간 비교 가능성이 향상되며, 이 접근이 프롬프트 기반 LLM 판단자보다 신뢰할 만하다고 보고한다(Gienapp et al., 2025). LLM에 대한 Soboroff의 조언은 더 단호하다. "TREC 방식의 평가를 위해 관련성 판단을 만드는 데 LLM을 사용하지 말라"(Soboroff, 2025). 4장에서는 LLM 판단을 신뢰하기 전에 상점의 사람 판단과 대조해 측정한다.

작업 규칙: 판단에 날짜를 기록하고, 운영 환경에서 judged@10을 추적하며, 판단을 다시 수행할 예산을 확보한다.

이 장이 내린 결정

마지막으로 변경된 판: 2026.11.8판

이후의 장들은 train 쿼리에 대한 측정이 달리 말해 주지 않는 한 이 결정을 그대로 따른다.

  • 사람의 판정이 기준이다. 이 책의 모든 대표 점수는 사람의 판정을 기준으로 계산하며, LLM으로 만든 랭커의 점수도 마찬가지이다. 클릭은 쇼핑객에 관한 증거일 뿐이며 위치와 표시 방식에 따라 편향되므로 레이블로 쓰지 않는다.
  • 등급 2, 1, 0이 이득값이다. 따라서 부분 일치는 완전 일치의 절반 가치를 가지며, 이는 WANDS 자체의 1.0, 0.5, 0과 같은 비율이다. 이진 지표는 완전 일치만 센다.
  • 쌍마다 하나의 등급을 둔다. WANDS가 한 쌍을 서로 다른 레이블로 여러 번 나열하면 표본은 더 낮은 등급을 택하며, 이는 랭커에 불리한 쪽으로 오차를 둔다.
  • query_class는 힌트이다. 레이블이 아니며 의도를 재는 척도도 아니다. 그 값 중 일부는 틀렸다.
  • 판정되지 않은 상품은 등급 0으로 계산하며, 모든 nDCG@10 옆에 judged@10을 함께 둔다. 압축 점수는 진단용일 뿐이다. 상위 10개에 판정되지 않은 상품이 있을 때의 해결책은 그 상품을 판정받게 하는 것이다.
  • 랭커는 속성이 아니라 상품 텍스트를 읽는다. 5장에서는 속성을 하나의 필드로 추가하는 방법을 시험하되, 속성을 BM25 텍스트에는 넣지 않는다. 판정자는 이미지와 상품 페이지도 보았으므로, 일부 완전 일치 상품은 텍스트만 쓰는 랭커가 대조할 만한 것을 거의 제공하지 않는다.
  • 어떤 판정이든 읽을 수 있지만, 튜닝은 train에서 한다. test 판정을 읽는다고 해서 랭커가 바뀌지는 않는다. 그러나 그 판정을 보고 수정 방법을 고르면 바뀐다.
  • 이 장이 보여 준 것: 점수는 판정만큼만 좋다.

이 판의 이 장

2026.11.10판예제 통과 2026년 11월 19이 장에서 10개 예제개 중 10개가 통과한다

영어판 2026.11.10판을 번역한 것이다.

이 절 인용

형식

각 형식은 이 번역이 따르는 영문 원서를 출처로 표기한다.

모든 형식은 이 판을 명시한다. 링크는 현재 판을 열며, 여기서 절의 제목은 본문이 마지막으로 바뀐 시점을 알려 준다. 접근 날짜와 검색 날짜는 이 자료를 여는 날짜다.

이 페이지의 내용

11장 중 2장: 관련성이 의미하는 것

  1. Judge relevance against the shopper's need
  2. 심사자들이 일부 쌍에서 서로 다르게 판단할 것을 예상한다
  3. Read intent as a product and its modifiers
  4. 예, 아니요 대신 관련도의 등급을 매긴다
  5. 이득값을 의도적으로 선택한다
  6. 쿼리별 레이블 구성 읽기
  7. 클릭을 편향된 증거로 다룬다
  8. 판단이 어디에서 왔는지 파악하라
  9. Count unjudged products before you compare scores
  10. 운영 환경에서 생기는 문제
  11. 이 장이 내린 결정

맨 위로 돌아가기전체 장