OP-Reddit-Post / README.md
mtybilly's picture
Document image metadata columns (#2)
168c6dd
|
Raw
History Blame Contribute Delete
29.3 kB
---
license: other
license_name: reddit-user-content
license_link: https://redditinc.com/policies/user-agreement
language:
- en
task_categories:
- text-classification
tags:
- reddit
- public-health
- harm-reduction
- opioid
- substance-use
- pseudonymized
pretty_name: "OP-R1 Reddit Posts (37 drug subreddits, 2016-2026)"
size_categories:
- 10M<n<100M
configs:
- config_name: default
data_files:
- split: train
path: "data/*/part-*.parquet"
- config_name: Drugs
data_files:
- split: train
path: "data/Drugs/part-*.parquet"
- config_name: LSD
data_files:
- split: train
path: "data/LSD/part-*.parquet"
- config_name: opiates
data_files:
- split: train
path: "data/opiates/part-*.parquet"
- config_name: cocaine
data_files:
- split: train
path: "data/cocaine/part-*.parquet"
- config_name: DMT
data_files:
- split: train
path: "data/DMT/part-*.parquet"
- config_name: MDMA
data_files:
- split: train
path: "data/MDMA/part-*.parquet"
- config_name: meth
data_files:
- split: train
path: "data/meth/part-*.parquet"
- config_name: benzodiazepines
data_files:
- split: train
path: "data/benzodiazepines/part-*.parquet"
- config_name: dxm
data_files:
- split: train
path: "data/dxm/part-*.parquet"
- config_name: Nootropics
data_files:
- split: train
path: "data/Nootropics/part-*.parquet"
- config_name: treedibles
data_files:
- split: train
path: "data/treedibles/part-*.parquet"
- config_name: ketamine
data_files:
- split: train
path: "data/ketamine/part-*.parquet"
- config_name: CannabisExtracts
data_files:
- split: train
path: "data/CannabisExtracts/part-*.parquet"
- config_name: DPH
data_files:
- split: train
path: "data/DPH/part-*.parquet"
- config_name: Ayahuasca
data_files:
- split: train
path: "data/Ayahuasca/part-*.parquet"
- config_name: 2cb
data_files:
- split: train
path: "data/2cb/part-*.parquet"
- config_name: fentanyl
data_files:
- split: train
path: "data/fentanyl/part-*.parquet"
- config_name: adderall
data_files:
- split: train
path: "data/adderall/part-*.parquet"
- config_name: cannabis
data_files:
- split: train
path: "data/cannabis/part-*.parquet"
- config_name: ambien
data_files:
- split: train
path: "data/ambien/part-*.parquet"
- config_name: mescaline
data_files:
- split: train
path: "data/mescaline/part-*.parquet"
- config_name: LSA
data_files:
- split: train
path: "data/LSA/part-*.parquet"
- config_name: dissociatives
data_files:
- split: train
path: "data/dissociatives/part-*.parquet"
- config_name: modafinil
data_files:
- split: train
path: "data/modafinil/part-*.parquet"
- config_name: 1P_LSD
data_files:
- split: train
path: "data/1P_LSD/part-*.parquet"
- config_name: afinil
data_files:
- split: train
path: "data/afinil/part-*.parquet"
- config_name: 5MeODMT
data_files:
- split: train
path: "data/5MeODMT/part-*.parquet"
- config_name: noids
data_files:
- split: train
path: "data/noids/part-*.parquet"
- config_name: 4acodmt
data_files:
- split: train
path: "data/4acodmt/part-*.parquet"
- config_name: MemantineHCl
data_files:
- split: train
path: "data/MemantineHCl/part-*.parquet"
- config_name: 1V_LSD
data_files:
- split: train
path: "data/1V_LSD/part-*.parquet"
- config_name: PCP
data_files:
- split: train
path: "data/PCP/part-*.parquet"
- config_name: MXE
data_files:
- split: train
path: "data/MXE/part-*.parquet"
- config_name: DMXE
data_files:
- split: train
path: "data/DMXE/part-*.parquet"
- config_name: DrugCombos
data_files:
- split: train
path: "data/DrugCombos/part-*.parquet"
- config_name: anabolic
data_files:
- split: train
path: "data/anabolic/part-*.parquet"
- config_name: AMT
data_files:
- split: train
path: "data/AMT/part-*.parquet"
extra_gated_heading: "Request access to the OP-R1 Reddit corpus"
extra_gated_button_content: "I agree to all terms above"
extra_gated_description: >-
This dataset contains pseudonymized but re-identifiable social-media content
about substance use. Access is reviewed manually and granted only for
public-health / harm-reduction research. Requests without a verifiable
institutional affiliation and a specific research purpose will be declined.
extra_gated_prompt: >-
**DATA USE AGREEMENT — read in full before requesting access.**
This corpus contains Reddit posts and comments about drug use, including
opioids. Author usernames are replaced by salted HMAC pseudonyms, but the
dataset **retains original Reddit post/comment identifiers** (`id`, `link_id`,
`parent_id`). Those identifiers can be resolved on reddit.com to the original
content and, where not deleted, to the author's real account. **Treat every
record as identifiable personal data concerning health and potentially
criminal conduct.**
By requesting access you represent that you have read this agreement and agree
to be bound by it.
**1. Permitted use.** Aggregate public-health, harm-reduction, epidemiological,
computational-social-science or NLP research, conducted under the oversight of
an IRB / research ethics committee (or a documented determination that such
oversight is not required in your jurisdiction).
**2. Prohibited uses.** You will NOT: (a) attempt to re-identify, deanonymize,
unmask or determine the real-world identity of any individual, including by
resolving retained Reddit identifiers, cross-referencing external data, or
querying any API or web service with dataset content; (b) contact, message,
survey, recruit, profile, monitor or surveil any individual represented in the
data; (c) use the data for law-enforcement, prosecutorial, immigration,
insurance, credit, employment or any other adverse determination about an
individual; (d) use it for commercial purposes, advertising, or targeting;
(e) use it to facilitate the acquisition or distribution of controlled
substances; (f) publish, present or otherwise disclose any verbatim quotation,
username, pseudonymous `user_id`, Reddit identifier, or any other detail that
could reasonably permit identification of an individual.
**3. No redistribution.** You will not republish, mirror, share, sublicense,
post to any public repository or model hub, or otherwise transfer the data or
any substantial derivative of it, in whole or in part, to any third party.
Access is personal to you. Collaborators must request access individually.
Models trained on this data must not be released if they can reproduce
identifying content.
**4. Security.** You will store the data on access-controlled systems,
restrict access to named personnel covered by this agreement, and not upload
it to third-party services (including commercial LLM APIs) that may retain,
train on, or disclose it.
**5. Underlying rights.** Content remains the intellectual property of its
original authors and is subject to the Reddit User Agreement. This dataset is
a research derivative; nothing here grants you rights in the underlying
content. You are responsible for your own compliance with Reddit's terms and
with all applicable law, including GDPR, HIPAA and equivalents.
**6. Deletion.** You will delete all copies upon completion of the stated
research, upon withdrawal of access, or on request of the maintainers.
**7. Incident reporting.** You will report any accidental disclosure,
re-identification, breach, or loss of control of the data to the maintainer
within 72 hours.
**8. Publication.** Report results in aggregate. Paraphrase rather than quote.
Cite the dataset and the upstream arctic_shift project.
**9. Termination.** Access may be revoked at any time, with or without cause.
Breach terminates your rights immediately and obliges you to delete all copies.
**10. No warranty.** Provided "as is", without warranty of any kind. The
maintainers accept no liability arising from your use. The data is a
non-representative convenience sample and must not be used for clinical,
diagnostic, or individual decision-making purposes.
extra_gated_fields:
Full name: text
Institutional email: text
Institution / organization: text
Role:
type: select
options: ["Faculty / PI", "Postdoc", "PhD student", "Masters/Undergrad student", "Research staff", "Industry researcher", "Other"]
Country: country
Supervisor or PI (if student): text
Describe your specific research question and intended use: text
IRB / ethics review status:
type: select
options: ["Approved - I can provide the protocol number", "Submitted, pending approval", "Formal determination that review is not required", "Not applicable - please explain above"]
I will not attempt to re-identify or deanonymize any individual: checkbox
I will not contact, survey, profile or surveil anyone in the data: checkbox
I will not use the data for law-enforcement or any adverse determination about an individual: checkbox
I will not redistribute the data or share my access with others: checkbox
I will not publish verbatim quotes, usernames or Reddit identifiers: checkbox
I will not upload the data to third-party services that may retain or train on it: checkbox
I will delete all copies when my research concludes or access is withdrawn: checkbox
I agree to the full Data Use Agreement above: checkbox
---
# OP-Reddit-Post — 37 drug subreddits, 2016–2026
Post-level corpus of **46,934,806** Reddit submissions and comments from **37
drug-related subreddits**, spanning **2016-01-01 → 2026-07-27**. Built for
[OP-R1](https://github.com/Tianyi-Billy-Ma), a reasoning model for
**opioid-involvement detection** from social-media history.
> **Access.** **Gated** dataset — access requests are reviewed manually and
> granted only for public-health / harm-reduction research under ethics oversight.
> IRB-gated human-subjects material.
> Intended for aggregate harm-reduction research — **not** for surveillance,
> deanonymization, law enforcement, or any action targeting individuals.
## Loading
Partitioned by subreddit, so one community can be pulled without downloading all
47M rows:
```python
from datasets import load_dataset
ds = load_dataset("OP-R1/OP-Reddit-Post", "opiates", split="train") # one subreddit
full = load_dataset("OP-R1/OP-Reddit-Post", split="train") # everything
```
## Layout
```
data/<subreddit>/part-NNNNN.parquet rows sorted by (user_id, created_utc)
index/user_index.parquet user_id -> file + row range
index/id_index.parquet id -> file + row offset
```
Two properties make targeted retrieval cheap:
1. **Rows are sorted by `user_id`**, and a given user is **never split across
files** within a subreddit — so one user's records are always a single
contiguous row range.
2. **Small Parquet row groups (2,000 rows)** mean an HTTP *ranged* read can pull
just the groups covering that range instead of the whole file.
## Efficient retrieval (without downloading the corpus)
`index/user_index.parquet` maps a user to their exact location:
| column | meaning |
|---|---|
| `user_id` | salted-HMAC pseudonym |
| `subreddit` | which partition |
| `path` | e.g. `data/opiates/part-00003.parquet` |
| `row_start`, `row_count` | contiguous row range inside that file |
| `first_utc`, `last_utc` | time span of that user's activity there |
`index/id_index.parquet` maps any `id` → `path` + `row_offset`, which is how you
resolve the anchor posts, parent comments and replies referenced by
[**OP-Reddit-User**](https://huggingface.co/datasets/OP-R1/OP-Reddit-User).
```python
from src.data.retrieve import OpR1Retriever
r = OpR1Retriever() # needs an approved token
user = r.get_user("18a38e35a00f09e39207") # profile + threads + text, fetched by range
```
Because 56% of users appear in exactly one subreddit (80% in ≤2), a typical
lookup is **one or two ranged reads of a few MB** rather than a 6.8 GB download.
## Companion dataset
[**OP-R1/OP-Reddit-User**](https://huggingface.co/datasets/OP-R1/OP-Reddit-User)
holds one row per user — profile, interaction summary, and thread/reply
*structure* — deliberately **without text**, so it stays small. Join it to this
dataset on `id` / `link_id` / `parent_id` to materialize the text.
---
## 1. Data sources
Two complementary sources, both derived from the [arctic_shift](https://github.com/ArthurHeitmann/arctic_shift)
Reddit archive. Neither content nor labels were authored by us.
| Source | Window | Subreddits | Records |
|---|---|---|---:|
| **Torrent dump** (Academic Torrents `56aa49f9653ba545f48df2e33679f014d2829c10`) | 2016-01-01 → 2023-12-31 | 28 | 36,513,028 |
| **arctic_shift HTTP API** | 2024-01-01 → 2026-07-27 (+ full window for 9 subs) | 37 | 10,421,778 |
| **Total** | **2016-01-01 → 2026-07-27** | **37** | **46,934,806** |
Every row records its own provenance in the **`source`** column, so the two
collection paths stay auditable and separable:
```python
ds.filter(lambda r: r["source"] == "api") # 10,421,778 rows
ds.filter(lambda r: r["source"] == "torrent") # 36,513,028 rows
```
Observed ranges by source: `torrent` = 2016-01-01 … 2023-12-31 (the dump's hard
cutoff); `api` = 2016-01-02 … 2026-07-27 — the early `api` dates are the 9
dump-absent subreddits, collected over their full window.
The torrent is listed in arctic_shift's `download_links.md` as
`2005-06 - 2023-12 top 40k subreddits`. That file documents the dump's existence
and link only — it is a two-column `Release | link` table and does **not** define
how the "top 40k" were selected. The criterion is stated on the linked Academic
Torrents page, which we could not fetch programmatically to quote verbatim.
**9 subreddits are absent from the torrent** (`1V_LSD`, `4acodmt`, `DMXE`,
`DrugCombos`, `MXE`, `MemantineHCl`, `PCP`, `AMT`, `anabolic`) and were collected
entirely via the API. Their absence is a **sampling artifact of the source, not
evidence they are inactive** — each falls below the smallest subreddit the dump
does include, which is consistent with a volume-based cutoff.
---
## 2. Acquisition methodology
Fully scripted; code in `src/data/` of the OP-R1 repository.
**Torrent path.** `.torrent` metadata fetched over HTTPS; a bencode parser mapped
target subreddit names to file indices; `aria2c --select-file` downloaded **only
56 of 79,895 files** (5.94 GB) rather than the full multi-TB archive. Each `.zst`
was stream-decompressed (`max_window_size=2**31`, byte-level newline splitting so
multi-byte UTF-8 is never severed), filtered by subreddit and date, and
normalized — parallelized as a 56-task array job on the Notre Dame CRC cluster.
**API path.** Paginated ascending by `created_utc` (100 rows/request, 1.5 s
politeness delay, rate-limit headers respected), checkpointed per
(subreddit, kind) so interruptions resume rather than restart. Collection was
sharded across four machines; two high-volume subreddits (`Drugs`, `meth`) were
further split by date range across machines. **Split boundaries were verified
contiguous and pairwise id-disjoint** before merging — no gaps, no duplicates.
### Data-quality handling
Real dump records contain occasional type inconsistencies (e.g. `parent_id`
sometimes an integer rather than `"t3_abc123"`). The exporter coerces defensively
and **reports counts** rather than failing or silently corrupting: string columns
via `str()`, integer columns to `null` on unparseable values, and records with an
unusable `created_utc` are **dropped and counted**.
For this release: **0 records dropped**, 1,785 values coerced. Rows out
(46,934,806) equals rows in — no silent loss.
---
## 3. De-identification
**This data is pseudonymized, not anonymized.** §3.3 is essential reading.
### 3.1 Removed
| Field | Treatment |
|---|---|
| `author` (username) | **Dropped.** Never written to disk in any output. |
| `permalink` | **Dropped** — links directly back to the live thread. |
### 3.2 Author pseudonymization
```
user_id = HMAC-SHA256(secret_salt, username).hexdigest()[:20]
```
- **Salt**: 256-bit (`openssl rand -hex 32`), stored mode `0600` on institutional
storage, **outside** the dataset; never published or transmitted with the data.
- **Irreversibility**: HMAC is one-way — the salt is not a decryption key and
cannot recover a username. What the salt *does* enable is **confirmation and
enumeration**: since Reddit usernames are public and enumerable, anyone holding
the salt could hash a username list and match it against `user_id`s. A plain
unsalted hash would offer no protection at all for this reason.
- **Stability**: the same salt is reused across releases, so `user_id` is
consistent over time and **joins to the OP-R1 user-level dataset**
(1,132,208 users).
- **Non-user accounts**: `[deleted]`, `[removed]`, `AutoModerator`
`user_id = null` (5,795,977 rows). Rows are kept for conversational context but
are attributable to no user.
### 3.3 Residual re-identification risk — important
**Reddit IDs are retained in cleartext.** `id`, `link_id` and `parent_id` are the
*live* Reddit identifiers, deliberately left unhashed so conversation threads can
be reconstructed and annotators can consult original context when assigning
labels. The direct consequence:
> Anyone holding this dataset can look up a row's `id` on Reddit and see the
> original author's real username. **No salt is required.** For any content not
> since deleted, the author pseudonymization can therefore be bypassed by anyone
> able to browse Reddit.
This is a conscious trade-off (thread structure + annotation utility vs. linkage
resistance), not an oversight. Hashing these fields with the same salt would
preserve thread structure while severing the lookup path, and **should be done
before any release wider than the current private, IRB-gated distribution.**
The `text` field is likewise **unmodified free-form prose** and may still contain
`u/username` mentions, self-disclosed location/age/employer/medical details, or
distinctive phrasing that is externally searchable. No text scrubbing and no
formal privacy guarantee (e.g. differential privacy) has been applied.
---
## 4. Data ranges
| | |
|---|---|
| **Coverage** | **2016-01-01 → 2026-07-27** (UTC) |
| **Lower bound** | Our filter — a ~10-year analysis window. Raw dumps reach to ~2008 (r/Drugs from 2008-02-09); re-parsing without the date floor recovers it at no extra download. |
| **Upper bound** | Collection date. The torrent alone stops at 2023-12-31; everything after is API-collected. |
Most subreddits start at the 2016-01-01 floor; later starts (e.g. `modafinil`
2016-11-16, `5MeODMT` 2016-06-22, `fentanyl` 2016-03-08) reflect **when the
community or its activity began**, not gaps in collection. A few end before
2026-07 where the community went inactive or was banned (e.g. `anabolic`
2025-08-11).
### Per-subreddit breakdown
| Subreddit | Rows | Posts | Comments | First | Last |
|---|---:|---:|---:|---|---|
| `Drugs` | 12,284,700 | 989,774 | 11,294,926 | 2016-01-01 | 2026-07-27 |
| `LSD` | 6,361,934 | 612,211 | 5,749,723 | 2016-01-01 | 2026-07-26 |
| `opiates` | 4,592,852 | 322,868 | 4,269,984 | 2016-01-01 | 2026-07-26 |
| `cocaine` | 4,127,039 | 732,132 | 3,394,907 | 2016-01-01 | 2026-07-27 |
| `DMT` | 2,599,118 | 204,192 | 2,394,926 | 2016-01-01 | 2026-07-26 |
| `MDMA` | 2,457,975 | 240,902 | 2,217,073 | 2016-01-01 | 2026-07-27 |
| `meth` | 2,410,585 | 216,372 | 2,194,213 | 2016-01-04 | 2026-07-27 |
| `benzodiazepines` | 2,352,722 | 241,865 | 2,110,857 | 2016-01-01 | 2026-07-26 |
| `dxm` | 1,869,737 | 181,775 | 1,687,962 | 2016-01-01 | 2026-07-27 |
| `Nootropics` | 1,658,708 | 154,486 | 1,504,222 | 2016-01-01 | 2026-07-27 |
| `treedibles` | 817,940 | 77,359 | 740,581 | 2016-01-01 | 2026-07-27 |
| `ketamine` | 798,317 | 78,175 | 720,142 | 2016-01-01 | 2026-07-27 |
| `CannabisExtracts` | 756,382 | 64,133 | 692,249 | 2016-01-01 | 2026-07-26 |
| `DPH` | 662,975 | 69,570 | 593,405 | 2016-01-02 | 2026-07-26 |
| `Ayahuasca` | 429,680 | 31,988 | 397,692 | 2016-01-01 | 2026-07-26 |
| `2cb` | 391,416 | 35,022 | 356,394 | 2016-01-25 | 2026-07-26 |
| `fentanyl` | 354,467 | 30,396 | 324,071 | 2016-03-08 | 2026-07-27 |
| `adderall` | 323,560 | 66,403 | 257,157 | 2016-01-01 | 2024-07-11 |
| `cannabis` | 255,977 | 42,304 | 213,673 | 2016-01-01 | 2026-07-27 |
| `ambien` | 254,144 | 40,283 | 213,861 | 2016-01-01 | 2026-07-27 |
| `mescaline` | 227,437 | 18,035 | 209,402 | 2016-01-03 | 2026-07-27 |
| `LSA` | 187,177 | 24,817 | 162,360 | 2016-01-03 | 2026-07-26 |
| `dissociatives` | 170,681 | 11,957 | 158,724 | 2016-01-01 | 2026-07-27 |
| `modafinil` | 160,650 | 18,434 | 142,216 | 2016-11-16 | 2026-07-27 |
| `1P_LSD` | 123,855 | 12,252 | 111,603 | 2016-01-01 | 2026-07-25 |
| `afinil` | 99,918 | 13,464 | 86,454 | 2016-01-01 | 2026-06-25 |
| `5MeODMT` | 95,987 | 7,524 | 88,463 | 2016-06-22 | 2026-07-26 |
| `noids` | 39,765 | 6,435 | 33,330 | 2016-01-01 | 2026-07-26 |
| `4acodmt` | 25,717 | 2,544 | 23,173 | 2017-01-07 | 2026-07-26 |
| `MemantineHCl` | 16,773 | 1,787 | 14,986 | 2017-01-05 | 2026-07-11 |
| `1V_LSD` | 8,419 | 1,013 | 7,406 | 2021-07-07 | 2026-07-24 |
| `PCP` | 7,439 | 699 | 6,740 | 2016-01-12 | 2026-07-08 |
| `MXE` | 3,385 | 393 | 2,992 | 2016-01-02 | 2026-07-22 |
| `DMXE` | 2,984 | 335 | 2,649 | 2020-12-11 | 2026-07-03 |
| `DrugCombos` | 2,115 | 610 | 1,505 | 2016-02-06 | 2026-07-23 |
| `anabolic` | 1,244 | 525 | 719 | 2016-01-11 | 2025-08-11 |
| `AMT` | 1,032 | 249 | 783 | 2016-02-16 | 2026-07-11 |
---
## Statistics
| Metric | Value |
|---|---|
| Rows | **46,934,806** |
| Submissions (`kind="post"`) | 4,553,283 (9.7%) |
| Comments (`kind="comment"`) | 42,381,523 (90.3%) |
| Distinct `user_id` | **2,195,320** |
| Rows with `user_id = null` | 5,795,977 (12.3%) |
| Rows by `source` | torrent 36,513,028 · api 10,421,778 |
| Subreddits | 37 |
| Files | 73 Parquet shards, 6.4 GB |
## Column reference
Every row is **one Reddit submission or one comment**.
| Column | Type | Meaning |
|---|---|---|
| `id` | `string` | Reddit's own base-36 identifier for this item (e.g. `d62k7k3`). Unique *within* a `kind`, **not** globally — key on (`kind`, `id`). This is a **live Reddit id**: see §3.3. |
| `kind` | `string` | `"post"` = a submission (thread starter). `"comment"` = a reply inside a thread. Determines how `text`, `link_id` and `parent_id` behave. |
| `subreddit` | `string` | Community the item was posted in, original capitalization (e.g. `Drugs`, `1P_LSD`). Also the partition directory name. |
| `source` | `string` | **How this row was collected.** `torrent` = bulk arctic_shift dump (2016-01-01 → 2023-12-31). `api` = live arctic_shift HTTP API (the 2024→2026 tail, **and** the full window for the 9 subreddits absent from the dump). Never null. |
| `user_id` | `string` (nullable) | Pseudonymous author id — salted HMAC of the username (§3.2). **Stable across rows and across the OP-R1 user-level dataset**, so it is the key for grouping a person's full history. `null` when the author was `[deleted]`/`[removed]`/`AutoModerator`. |
| `created_utc` | `int64` | Post time, Unix seconds UTC. Use for chronological ordering and time-window slicing. |
| `text` | `string` | The content. For a **post**: `title` + `"\n\n"` + `selftext` (title alone if there is no body). For a **comment**: the comment `body`. Unmodified prose — see §3.3. |
| `score` | `int64` (nullable) | Net votes **at the time of archival**, not current. Treat as a weak popularity signal, not ground truth. |
| `link_id` | `string` (nullable) | For comments: the **submission the comment belongs to**, as `t3_<id>`. `null` for posts. All comments sharing a `link_id` are in the same thread. |
| `parent_id` | `string` (nullable) | For comments: the **immediate parent**. `t3_<id>` = a top-level comment replying to the post; `t1_<id>` = a reply to another *comment*. `null` for posts. |
| `image_url` | `string` (nullable) | For posts: the submission's `url`. For an image post this is the direct media link (`i.redd.it`, `imgur`, …); for a self/text post it is the thread's own permalink. `null` for comments. |
| `post_hint` | `string` (nullable) | Reddit's own content classification — `image`, `link`, `self`, `hosted:video`, `rich:video`. `null` for comments and for the minority of posts Reddit never classified. |
| `is_gallery` | `bool` (nullable) | `true` when the post is a multi-image gallery. `null` for comments and non-gallery posts. |
| `has_image` | `bool` | **Never null.** `true` when the post resolves to at least one image. Derived from `post_hint == "image"` OR an image-bearing URL (`i.redd.it`, `imgur`, or an image extension), so it also catches galleries and imgur links that Reddit labels `link`. Always `false` for comments. |
### Image columns
Four columns describe attached images. They are the selection key for the
companion **OP-Reddit-Image** dataset, which mirrors this one and adds the
retrieved image bytes.
`has_image` is the column to filter on — it is never null, and it is `true` for
**656,932** of the 4,553,283 posts (14.4%). It is deliberately broader than
`post_hint == "image"` (307,058 + 98,607 posts): galleries and direct imgur
links are labelled `link` by Reddit but do carry images.
A caveat on provenance. The bulk arctic_shift dumps expose `post_hint`,
`is_gallery` and `gallery_data`, but the live search API used for the
2024-onward tail exposes none of them. Rather than leave the tail with
URL-guessed metadata, those rows were re-hydrated by id through the API's
`/api/posts/ids` endpoint, which does return the full object — so
`post_hint` and `is_gallery` are real values across **both** eras, not
inferred for the newer one. Some individual posts still carry a null
`post_hint` simply because Reddit never classified them.
Comments never carry images: `has_image` is `false` and the other three are
`null` for every one of the 42.4M comment rows.
### Reddit type prefixes
`link_id`/`parent_id` use Reddit's "fullname" format — a type prefix plus a base-36 id:
| Prefix | Refers to |
|---|---|
| `t1_` | a **comment** |
| `t3_` | a **submission (post)** |
### Reconstructing a thread
```python
# all comments in one thread
thread = ds.filter(lambda r: r["link_id"] == "t3_4v3or3")
# a comment's parent: strip the prefix and match against `id`
parent_key = row["parent_id"].split("_", 1)[1] # "t1_dbr0c7i" -> "dbr0c7i"
# parent is a post if parent_id starts with t3_, else another comment
```
Worked example (real rows from `fentanyl`):
| kind | id | link_id | parent_id | reads as |
|---|---|---|---|---|
| post | `49hs15` | `null` | `null` | thread starter |
| comment | `d62k7k3` | `t3_4v3or3` | `t3_4v3or3` | top-level reply to post `4v3or3` |
| comment | `dbrp9pv` | `t3_5jto90` | `t1_dbr0c7i` | reply to comment `dbr0c7i`, in thread `5jto90` |
When `link_id == parent_id`, the comment is top-level; when they differ, it is
nested under another comment.
### For the OP-R1 task
Group by `user_id` and order by `created_utc` to obtain a user's full posting
history — the classification unit for buyer/seller/user. `link_id`/`parent_id`
supply conversational context (what a user was responding to), which often
carries the intent signal that an isolated comment lacks.
## Intended use & limitations
**Intended:** aggregate public-health and harm-reduction research — modeling
opioid involvement, studying discourse, designing early intervention.
**Out of scope:** identifying or profiling individuals; law-enforcement or
punitive use; contacting users; any deployment implying clinical diagnosis.
**Limitations**
- **Not a population sample.** Reddit drug-subreddit participants are
self-selected and skew young, Western, English-speaking, internet-active.
- **Survivorship bias — most consequential for this task.** Moderation removes
exactly the sourcing/transaction language that distinguishes *buyer* from
*seller*, so those signals are systematically **under**-represented relative to
their true prevalence.
- **Class imbalance.** Explicit sourcing content is rare next to
experience-sharing.
- **Comment-dominated** (90.3%), so most user evidence is short conversational
text rather than long-form posts.
- **Point-in-time `score`** as archived; not current.
- **No labels.** `role` (buyer/seller/user) is *not* present — this is an
unlabeled corpus.
## Provenance & citation
Derived from arctic_shift; cite that project for the underlying archive. Reddit
content belongs to its original authors.
Maintainer: Tianyi (Billy) Ma · `tma2@nd.edu` · University of Notre Dame