The data
Each claim is a dictionary with its text and a list of sources:
{
"text": "The online assessment is one problem with about four levels",
"sources": [
{"kind": "candidate", "independent_id": "forum-post-a"},
{"kind": "guide", "independent_id": "prep-blog-b"},
{"kind": "candidate", "independent_id": "forum-post-c"},
],
}
kindis"company"(the lab itself: careers page, job posting, official guidance),"candidate"(a first-hand account),"guide"(a prep site or career-centre article) or"news". Your notes may contain other kinds, such as"friend". Those don't count as evidence.independent_idnames the original source. Two entries with the same id are the same source, even if they arrived by different routes (for example, two blogs quoting the same forum post were both given that post's id).
Your task
Write two functions.
1. label_claim(claim) returns one string:
| Return | When |
|---|---|
"official" |
Any source has kind "company". |
"reported" |
Otherwise, at least 3 distinct independent_id values among sources of kind "candidate", "guide" or "news". |
"anecdotal" |
Otherwise, 1 or 2 distinct ids among those kinds. |
"unsupported" |
No sources of those kinds at all (including an empty list). |
2. prep_priorities(claims) returns a list of claim texts to prepare for:
- Official claims first, then reported, then anecdotal.
- Drop unsupported claims entirely.
- Claims with the same label keep their original order.
- Don't modify the input list.
Example
notes = [
{"text": "Live interviews are AI-free unless they say otherwise",
"sources": [{"kind": "company", "independent_id": "careers-page"}]},
{"text": "The online assessment is one problem with about four levels",
"sources": [{"kind": "candidate", "independent_id": "forum-post-a"},
{"kind": "guide", "independent_id": "prep-blog-b"},
{"kind": "candidate", "independent_id": "forum-post-c"}]},
{"text": "Interviewers like hearing about a favourite paper",
"sources": [{"kind": "guide", "independent_id": "prep-blog-b"},
{"kind": "guide", "independent_id": "prep-blog-b"}]}, # one source, twice
{"text": "You must memorise the lab's essays",
"sources": [{"kind": "friend", "independent_id": "my-cousin"}]}, # not evidence
]
[label_claim(n) for n in notes]
# -> ["official", "reported", "anecdotal", "unsupported"]
prep_priorities(notes)
# -> ["Live interviews are AI-free unless they say otherwise",
# "The online assessment is one problem with about four levels",
# "Interviewers like hearing about a favourite paper"]
The example notes are practice data for this exercise, not research findings. Press Run to try your code on them, then Submit to grade it.
Coach's tip: The distinct-id rule is the one that matters in real life. A claim repeated by ten prep sites that all copied one forum post is still one account. Before you trust a "fact", trace it back to where it started.