forked from rohitg00/ai-engineering-from-scratch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.json
More file actions
78 lines (78 loc) · 3.22 KB
/
Copy pathquiz.json
File metadata and controls
78 lines (78 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"lesson": "51-literature-retrieval",
"title": "Literature Retrieval",
"questions": [
{
"stage": "pre",
"question": "Why does the retrieval client run a BM25 pass and a citation graph pass?",
"options": [
"Because BM25 needs the graph to build its index",
"Because lexical hits miss foundational papers with different vocabulary, and graph hits miss papers that share no citation with the seed",
"Because the mock APIs require it",
"Because the parser fails otherwise"
],
"correct": 1,
"explanation": "Each pass catches what the other misses. Lexical covers shared vocabulary; the graph covers ancestor and descendant papers regardless of vocabulary."
},
{
"stage": "pre",
"question": "Why is the citation graph traversal capped at two hops?",
"options": [
"Because beyond two hops the result set tends to drift off topic and overwhelm downstream ranking",
"Because the Python recursion limit forbids three hops",
"Because BM25 only scores two hops away",
"Because the corpus only stores two layers of citations"
],
"correct": 0,
"explanation": "Two hops is the practical ceiling. Three hops blows up the result set on a connected graph and rarely returns more on topic papers."
},
{
"stage": "check",
"question": "What does idf evaluate to for a term that appears in every document?",
"options": [
"A large positive value",
"A value near zero",
"Negative infinity",
"Undefined; the BM25 implementation skips it"
],
"correct": 1,
"explanation": "When df equals N the numerator and denominator inside the log are close, and the +1 keeps the term non negative but small. The contribution of universally common terms is near zero."
},
{
"stage": "check",
"question": "Which keys does the merge step use to dedup hits from the two passes?",
"options": [
"Title text",
"Stable paper id",
"Year and first author",
"BM25 score bucket"
],
"correct": 1,
"explanation": "Paper id is the stable handle. Title and author are duplicated across versions, year alone is ambiguous."
},
{
"stage": "check",
"question": "What does graph_score return for a paper that is two hops from the seed set?",
"options": [
"Zero",
"0.3 by default",
"1.0 by default",
"The BM25 score divided by ten"
],
"correct": 1,
"explanation": "The default graph score schedule is 1.0 at zero hops, 0.6 at one hop, 0.3 at two hops, and zero beyond that."
},
{
"stage": "check",
"question": "Why is the corpus loaded once into a RetrievalClient instead of refetched per query?",
"options": [
"Because the mock APIs are slow on every call",
"Because the BM25 index and citation graph are built once at construction time and reused across queries",
"Because the parser is global",
"Because the recency score requires it"
],
"correct": 1,
"explanation": "Index construction is the expensive step. Reusing the index amortises that cost across every query the client handles."
}
]
}