Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Derive the relabel dataset's pool summary from the data

Daoud Clarkee7690d92c981
diff --git a/scripts/llm_relabel_build_dataset.py b/scripts/llm_relabel_build_dataset.py
index ef88352..836d25f 100644
--- a/scripts/llm_relabel_build_dataset.py
+++ b/scripts/llm_relabel_build_dataset.py
@@ -65,8 +65,13 @@ def main():
df.to_csv(OUT, errors="replace")
print(f"Wrote {OUT}: {len(df)} rows, {df['query'].nunique()} queries")
print("\nlabel means by pool membership:")
- for tag in ("standard", "supersearch", "google"):
- sub = df[df["pools"].str.contains(tag)]
+ # Derived from the data rather than listed: a hardcoded list silently omits any pool
+ # added later - which is the one whose grade distribution is worth looking at. Matched on
+ # the split rather than with str.contains, so one tag can never be read as a prefix of
+ # another.
+ membership = df["pools"].str.split("|")
+ for tag in sorted({tag for tags in membership for tag in tags if tag}):
+ sub = df[membership.apply(lambda tags, t=tag: t in tags)]
if len(sub):
print(
f" {tag:12s} n={len(sub):6d} relevance={sub.relevance.mean():.2f} "