dipikakhullar commited on
Commit
98ed9c8
·
verified ·
1 Parent(s): fc468e1

docs: dataset README (schema, source, heuristic)

Browse files
Files changed (1) hide show
  1. README.md +81 -0
README.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # personalization-reddit
2
+
3
+ Per-subreddit `(query, preferred_answer)` pairs mined from Reddit using an
4
+ **OP-thanks-reply** heuristic: when the original poster (OP) replies to a
5
+ comment with thanks/gratitude, that parent comment is treated as their
6
+ preferred answer to their own question.
7
+
8
+ ## Source
9
+
10
+ Raw post + comment dumps from the
11
+ [arctic_shift](https://github.com/ArthurHeitmann/arctic_shift) Pushshift
12
+ mirror, fetched per-subreddit (entire history through the fetch date) and
13
+ extracted with the pipeline in `may_15/reddit_pipeline/` of the
14
+ `personalization` repo.
15
+
16
+ Raw NDJSON dumps are kept locally and are not redistributed here.
17
+
18
+ ## Files
19
+
20
+ ```
21
+ extracted/
22
+ pairs/sub-<subreddit>.jsonl # one (query, preferred_answer) per line
23
+ stats/sub-<subreddit>.json # funnel counts per subreddit
24
+ ```
25
+
26
+ Each pair file is independent — load one sub or `concatenate_datasets` to
27
+ combine.
28
+
29
+ ## Record schema (`pairs/sub-*.jsonl`)
30
+
31
+ | field | type | description |
32
+ |---|---|---|
33
+ | `user_id` | str | anonymized OP id (HMAC of Reddit username, see `anon.py`) |
34
+ | `timestamp` | str | post creation, ISO 8601 UTC |
35
+ | `subreddit` | str | source subreddit name |
36
+ | `query` | str | post title, with selftext appended if present |
37
+ | `preferred_answer` | str | body of the comment OP thanked (via parent of the thanks reply) |
38
+ | `top_comment` | str \| null | body of the highest-scoring non-OP comment (may equal preferred) |
39
+ | `metadata` | object | see below |
40
+
41
+ `metadata` sub-object:
42
+
43
+ | field | type | description |
44
+ |---|---|---|
45
+ | `post_id` | str | Reddit submission id |
46
+ | `post_score` | int | submission score at fetch time |
47
+ | `answer_comment_id` | str | comment id of the preferred answer |
48
+ | `answer_score` | int | preferred-answer score at fetch time |
49
+ | `answerer_anon_id` | str | anonymized author id of the preferred answer |
50
+ | `top_comment_id` | str \| null | comment id of the top-scoring non-OP comment |
51
+ | `top_comment_score` | int \| null | top comment score |
52
+ | `top_comment_anon_id` | str \| null | anonymized top-comment author id |
53
+ | `top_equals_preferred` | bool | whether the preferred answer is also the top comment |
54
+ | `thanks_reply_id` | str | OP's thanks-reply comment id (the signal that triggered the pair) |
55
+ | `thanks_reply_score` | int | score of OP's thanks reply |
56
+ | `thanks_reply_text` | str | body of OP's thanks reply |
57
+ | `thanks_reply_timestamp` | str | thanks reply creation, ISO 8601 UTC |
58
+
59
+ ## Heuristic — OP thanks-reply
60
+
61
+ For each post that passes a question filter:
62
+ 1. Find comments whose author == OP and whose body matches a "thanks"
63
+ pattern (see `signals.py::is_thanks_reply`).
64
+ 2. The parent of each such reply is recorded as a candidate "preferred answer".
65
+ 3. Materialize each candidate into a pair, joining post metadata + answer body
66
+ + thanks-reply context.
67
+
68
+ Bots and deleted/removed authors are filtered out before pair emission
69
+ (`signals.py`, `subreddits.py::BOT_AUTHORS`).
70
+
71
+ ## Anonymization
72
+
73
+ Reddit usernames are hashed via HMAC-SHA256 with a per-run secret salt
74
+ (`anon.py::anon_user_id`) before being written. Post/comment ids and text
75
+ bodies are kept verbatim — content from public Reddit threads can still be
76
+ re-identified by searching the post id or quoting the body.
77
+
78
+ ## Subreddits included in this snapshot
79
+
80
+ See `extracted/stats/` for the list and per-sub funnel counts
81
+ (`rs_records_scanned`, `keep_posts`, `thanks_refs`, `pairs_emitted`, etc.).