Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"source": [
"# Find the Order \u2014 Baseline solution\n",
"\n",
"A **deterministic** baseline. It uses `prefix.json` \u2014 the two chunks known to come\n",
"first \u2014 and leaves every other chunk in the order it was given.\n",
"A **deterministic** baseline. It leaves every chunk in increasing order.\n",
"\n",
"It writes **`answers.json`** at the repo root in the rank convention: `P[i]` is the\n",
"predicted chronological position of `chunk_i.wav`.\n",
Expand Down Expand Up @@ -54,12 +53,7 @@
"answers = {}\n",
"for did in dialogue_ids:\n",
" n = n_chunks(os.path.join(TEST_DIR, did))\n",
" first, second = prefix[did]\n",
" order = [first, second] + [i for i in range(n) if i not in (first, second)]\n",
" rank = [0] * n # rank[i] = position of chunk_i\n",
" for pos, idx in enumerate(order):\n",
" rank[idx] = pos\n",
" answers[did] = rank\n",
" answers[did] = list(range(n))\n",
"\n",
"with open(OUTPUT, \"w\") as f:\n",
" json.dump(answers, f)\n",
Expand Down Expand Up @@ -201,4 +195,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
12 changes: 3 additions & 9 deletions Individual-Contest/1_Find_the_Order/code/baseline/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"source": [
"# Find the Order — Baseline solution\n",
"\n",
"A **deterministic** baseline. It uses `prefix.json` — the two chunks known to come\n",
"first — and leaves every other chunk in the order it was given.\n",
"A **deterministic** baseline. It leaves every chunk in increasing order.\n",
"\n",
"It writes **`answers.json`** at the repo root in the rank convention: `P[i]` is the\n",
"predicted chronological position of `chunk_i.wav`.\n",
Expand Down Expand Up @@ -68,12 +67,7 @@
"answers = {}\n",
"for did in dialogue_ids:\n",
" n = n_chunks(os.path.join(TEST_DIR, did))\n",
" first, second = prefix[did]\n",
" order = [first, second] + [i for i in range(n) if i not in (first, second)]\n",
" rank = [0] * n # rank[i] = position of chunk_i\n",
" for pos, idx in enumerate(order):\n",
" rank[idx] = pos\n",
" answers[did] = rank\n",
" answers[did] = list(range(n))\n",
"\n",
"with open(OUTPUT, \"w\") as f:\n",
" json.dump(answers, f)\n",
Expand Down Expand Up @@ -215,4 +209,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}