Add Reddit comment-tree sample skeleton; data pending
Browse files- README.md +149 -0
- data/comments/subreddit=LocalLLaMA/.gitkeep +0 -0
- data/comments/subreddit=SkincareAddiction/.gitkeep +0 -0
- data/comments/subreddit=wallstreetbets/.gitkeep +0 -0
- data/posts/subreddit=LocalLLaMA/.gitkeep +0 -0
- data/posts/subreddit=SkincareAddiction/.gitkeep +0 -0
- data/posts/subreddit=wallstreetbets/.gitkeep +0 -0
- examples/load.py +31 -0
- stats/summary.json +82 -0
README.md
CHANGED
|
@@ -1,3 +1,152 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
task_categories:
|
| 6 |
+
- text-generation
|
| 7 |
+
- text-classification
|
| 8 |
+
tags:
|
| 9 |
+
- reddit
|
| 10 |
+
- social-media
|
| 11 |
+
- comments
|
| 12 |
+
- conversation
|
| 13 |
+
- conversational-tree
|
| 14 |
+
pretty_name: Reddit Comment Trees Sample — Release in preparation
|
| 15 |
+
configs:
|
| 16 |
+
- config_name: posts
|
| 17 |
+
data_files:
|
| 18 |
+
- split: train
|
| 19 |
+
path: data/posts/**/*.parquet
|
| 20 |
+
- config_name: comments
|
| 21 |
+
data_files:
|
| 22 |
+
- split: train
|
| 23 |
+
path: data/comments/**/*.parquet
|
| 24 |
---
|
| 25 |
+
|
| 26 |
+
# Reddit Comment Trees Sample — Release in preparation
|
| 27 |
+
|
| 28 |
+
> **Preparing the first release. No Reddit records have been uploaded yet.**
|
| 29 |
+
> The table schemas and loading examples are ready; Dataset Viewer previews become available after real Parquet files are published.
|
| 30 |
+
|
| 31 |
+
## Overview
|
| 32 |
+
|
| 33 |
+
A sample of posts and comment trees from **r/LocalLLaMA, r/wallstreetbets, and r/SkincareAddiction**.
|
| 34 |
+
The sample is designed for one agreed three-month release window. Its exact UTC boundaries are **pending confirmation** before the first data upload.
|
| 35 |
+
Actual coverage, post and comment counts, and tree completeness are pending validation of the first release.
|
| 36 |
+
Comment relationships are preserved through `link_id`, `parent_id`, and `depth`.
|
| 37 |
+
|
| 38 |
+
## Why this dataset exists
|
| 39 |
+
|
| 40 |
+
Public Reddit archives include data after the 2023 API changes; freshness alone is not a unique feature.
|
| 41 |
+
This sample focuses on documented time coverage, explicit post/comment relationships, typed columns, and reproducible collection snapshots.
|
| 42 |
+
The three communities provide examples of AI discussion, market discussion, and consumer product feedback.
|
| 43 |
+
The release will report observed gaps instead of treating unavailable records as successfully collected data.
|
| 44 |
+
|
| 45 |
+
## Coverage
|
| 46 |
+
|
| 47 |
+
| Subreddit | Posts | Comments | Actual post coverage (UTC) | Maximum comment depth |
|
| 48 |
+
|---|---:|---:|---|---:|
|
| 49 |
+
| LocalLLaMA | Pending | Pending | Pending | Pending |
|
| 50 |
+
| wallstreetbets | Pending | Pending | Pending | Pending |
|
| 51 |
+
| SkincareAddiction | Pending | Pending | Pending | Pending |
|
| 52 |
+
|
| 53 |
+
The planned window selects **posts**. Available comments on those posts form a collection-time snapshot and may be newer than the selected post window.
|
| 54 |
+
Exact comment timestamp ranges and tree completeness will be reported separately after validation.
|
| 55 |
+
Unknown statistics in [stats/summary.json](stats/summary.json) are `null`, not zero.
|
| 56 |
+
No estimated size category is advertised before the record counts are known.
|
| 57 |
+
|
| 58 |
+
## Schema
|
| 59 |
+
|
| 60 |
+
Both tables use **Parquet with Zstandard compression**. Text is not truncated; timestamps are Unix seconds in UTC.
|
| 61 |
+
Media files are not included. Preserve source text, except any documented anonymization.
|
| 62 |
+
Record any anonymization policy in the first release's collection notes before uploading the data.
|
| 63 |
+
|
| 64 |
+
### Posts
|
| 65 |
+
|
| 66 |
+
| Field | Type | Description |
|
| 67 |
+
|---|---|---|
|
| 68 |
+
| id | string | Post ID without the `t3_` prefix |
|
| 69 |
+
| subreddit | string | One of the three listed communities |
|
| 70 |
+
| author | string | Source author; deleted accounts use `[deleted]` |
|
| 71 |
+
| created_utc | int64 | Post creation time, Unix seconds UTC |
|
| 72 |
+
| title | string | Original post title |
|
| 73 |
+
| selftext | string | Original post text; empty string for a link post |
|
| 74 |
+
| url | string | External URL or post permalink |
|
| 75 |
+
| score | int32 | Score snapshot at collection time |
|
| 76 |
+
| upvote_ratio | float32 | Source upvote ratio |
|
| 77 |
+
| num_comments | int32 | Reddit's displayed count; may differ from collected rows |
|
| 78 |
+
| flair | string | Nullable post flair |
|
| 79 |
+
| is_nsfw | bool | Source NSFW flag |
|
| 80 |
+
| permalink | string | Reddit permalink |
|
| 81 |
+
| crawled_at | int64 | Collection time, Unix seconds UTC |
|
| 82 |
+
| batch_id | string | Collection batch identifier |
|
| 83 |
+
|
| 84 |
+
### Comments
|
| 85 |
+
|
| 86 |
+
| Field | Type | Description |
|
| 87 |
+
|---|---|---|
|
| 88 |
+
| id | string | Comment ID without the `t1_` prefix |
|
| 89 |
+
| subreddit | string | Same community as the linked post |
|
| 90 |
+
| link_id | string | Linked post ID without the `t3_` prefix |
|
| 91 |
+
| parent_id | string | Unprefixed parent ID; top-level comments use `link_id` |
|
| 92 |
+
| depth | int16 | Top-level comments have depth 0 |
|
| 93 |
+
| author | string | Source author; deleted accounts use `[deleted]` |
|
| 94 |
+
| created_utc | int64 | Comment creation time, Unix seconds UTC |
|
| 95 |
+
| body | string | Original text; preserve `[deleted]` and `[removed]` markers |
|
| 96 |
+
| score | int32 | Score snapshot at collection time |
|
| 97 |
+
| is_submitter | bool | Whether the author is the post's submitter |
|
| 98 |
+
| permalink | string | Reddit permalink |
|
| 99 |
+
| crawled_at | int64 | Collection time, Unix seconds UTC |
|
| 100 |
+
| batch_id | string | Collection batch identifier |
|
| 101 |
+
|
| 102 |
+
Resolve a depth-0 parent against **posts**; resolve a deeper parent against **comments**, within the same subreddit and `link_id`.
|
| 103 |
+
Post and comment IDs belong to different namespaces even when their prefixes are removed.
|
| 104 |
+
The two HF configurations are `posts` and `comments`, each with a `train` split used as a storage partition, not a predefined ML training benchmark.
|
| 105 |
+
Subreddit folders group files; they do not automatically become separate HF configurations.
|
| 106 |
+
|
| 107 |
+
## Collection method and known gaps
|
| 108 |
+
|
| 109 |
+
The exact collection entry point, pagination coverage, comment expansion method, and crawl interval are **pending verification with the running collection batch**.
|
| 110 |
+
No claim of complete comment trees is made until parent links, depth consistency, and comment-expansion results are checked.
|
| 111 |
+
Scores and `num_comments` are snapshots, not lifetime totals; edits, removals, unavailable replies, timing differences, and incomplete expansion can change the counts.
|
| 112 |
+
`[deleted]` and `[removed]` markers remain visible. Missing data and unresolved parents will be reported rather than silently counted as empty results.
|
| 113 |
+
|
| 114 |
+
## Load the data
|
| 115 |
+
|
| 116 |
+
These examples work **after the first real data upload**. There are no placeholder Parquet rows.
|
| 117 |
+
Choose a config explicitly because posts and comments have different schemas.
|
| 118 |
+
See [examples/load.py](examples/load.py) for separate `datasets`, pandas, and DuckDB examples.
|
| 119 |
+
|
| 120 |
+
```python
|
| 121 |
+
from datasets import load_dataset
|
| 122 |
+
comments = load_dataset("mashu-data/reddit-comments-sample", "comments", split="train", streaming=True)
|
| 123 |
+
print(next(iter(comments)))
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
```python
|
| 127 |
+
import duckdb
|
| 128 |
+
con = duckdb.connect()
|
| 129 |
+
con.execute("INSTALL httpfs; LOAD httpfs;")
|
| 130 |
+
con.sql("""
|
| 131 |
+
SELECT id, link_id, parent_id, depth
|
| 132 |
+
FROM read_parquet(
|
| 133 |
+
'hf://datasets/mashu-data/reddit-comments-sample/data/comments/subreddit=LocalLLaMA/*.parquet',
|
| 134 |
+
hive_partitioning=false
|
| 135 |
+
) LIMIT 20
|
| 136 |
+
""").show()
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
## Full dataset and custom delivery
|
| 140 |
+
|
| 141 |
+
**Need more communities, a longer time range, or specific fields? [Contact Mashu Data](https://mashudata.com/contact.html).**
|
| 142 |
+
The full-dataset offering is being prepared for **20+ communities, a rolling 12-month window, and weekly incremental updates**.
|
| 143 |
+
These are target coverage and delivery terms, not a statement that all data or scheduled updates are already available.
|
| 144 |
+
Ask about verified batch availability and custom subreddit, date-range, or field selection before ordering.
|
| 145 |
+
Website: [mashudata.com](https://mashudata.com).
|
| 146 |
+
|
| 147 |
+
## License and use
|
| 148 |
+
|
| 149 |
+
The sample is designated **CC BY-NC 4.0** for non-commercial research use, to the extent Mashu Data holds rights in the released material.
|
| 150 |
+
Reddit users retain rights in their content; the repository license does not replace those rights or grant rights held by third parties.
|
| 151 |
+
For commercial use or delivery terms, [contact Mashu Data](https://mashudata.com/contact.html).
|
| 152 |
+
Cite the dataset repository and the exact revision used in your work; this dataset is not affiliated with or endorsed by Reddit.
|
data/comments/subreddit=LocalLLaMA/.gitkeep
ADDED
|
File without changes
|
data/comments/subreddit=SkincareAddiction/.gitkeep
ADDED
|
File without changes
|
data/comments/subreddit=wallstreetbets/.gitkeep
ADDED
|
File without changes
|
data/posts/subreddit=LocalLLaMA/.gitkeep
ADDED
|
File without changes
|
data/posts/subreddit=SkincareAddiction/.gitkeep
ADDED
|
File without changes
|
data/posts/subreddit=wallstreetbets/.gitkeep
ADDED
|
File without changes
|
examples/load.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run ONE example after the first real Parquet release; dependencies run in Docker."""
|
| 2 |
+
import argparse
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def main():
|
| 6 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 7 |
+
parser.add_argument('library', choices=['datasets', 'pandas', 'duckdb'])
|
| 8 |
+
parser.add_argument('--repo', required=True, help='HF dataset ID: mashu-data/repository-name')
|
| 9 |
+
args = parser.parse_args()
|
| 10 |
+
if args.library == 'datasets':
|
| 11 |
+
from datasets import load_dataset
|
| 12 |
+
comments = load_dataset(args.repo, 'comments', split='train', streaming=True)
|
| 13 |
+
print(next(iter(comments)))
|
| 14 |
+
elif args.library == 'pandas':
|
| 15 |
+
import pandas as pd
|
| 16 |
+
# Read one real shard, not the full dataset, into memory.
|
| 17 |
+
url = f'https://huggingface.co/datasets/{args.repo}/resolve/main/data/comments/subreddit=LocalLLaMA/part-0.parquet'
|
| 18 |
+
comments = pd.read_parquet(url)
|
| 19 |
+
print(comments[['id', 'link_id', 'parent_id', 'depth']].head())
|
| 20 |
+
else:
|
| 21 |
+
import duckdb
|
| 22 |
+
# httpfs handles hf:// paths; run in a Docker environment with network access.
|
| 23 |
+
conn = duckdb.connect()
|
| 24 |
+
conn.execute('INSTALL httpfs; LOAD httpfs;')
|
| 25 |
+
path = f'hf://datasets/{args.repo}/data/comments/subreddit=LocalLLaMA/*.parquet'
|
| 26 |
+
rows = conn.execute('SELECT id, link_id, parent_id, depth FROM read_parquet(?, hive_partitioning=false) LIMIT 20', [path]).fetchall()
|
| 27 |
+
print(rows)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
if __name__ == '__main__':
|
| 31 |
+
main()
|
stats/summary.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"status": "awaiting_data",
|
| 3 |
+
"repo_id": "mashu-data/reddit-comments-sample",
|
| 4 |
+
"generated_at": null,
|
| 5 |
+
"planned_post_date_range_utc": [
|
| 6 |
+
null,
|
| 7 |
+
null
|
| 8 |
+
],
|
| 9 |
+
"post_window_end_exclusive": true,
|
| 10 |
+
"date_range_utc": [
|
| 11 |
+
null,
|
| 12 |
+
null
|
| 13 |
+
],
|
| 14 |
+
"comment_date_range_utc": [
|
| 15 |
+
null,
|
| 16 |
+
null
|
| 17 |
+
],
|
| 18 |
+
"date_range_convention": "actual ranges are observed minimum and maximum created_utc; planned post range is half-open",
|
| 19 |
+
"comment_scope": "available comment trees for selected posts at crawl time; comments may be outside the post window",
|
| 20 |
+
"crawl_method": null,
|
| 21 |
+
"anonymization_policy": null,
|
| 22 |
+
"tree_completeness_verified": false,
|
| 23 |
+
"subreddits": {
|
| 24 |
+
"LocalLLaMA": {
|
| 25 |
+
"posts": null,
|
| 26 |
+
"comments": null,
|
| 27 |
+
"post_date_range_utc": [
|
| 28 |
+
null,
|
| 29 |
+
null
|
| 30 |
+
],
|
| 31 |
+
"comment_date_range_utc": [
|
| 32 |
+
null,
|
| 33 |
+
null
|
| 34 |
+
],
|
| 35 |
+
"max_depth": null,
|
| 36 |
+
"depth_distribution": null,
|
| 37 |
+
"deleted_ratio": null,
|
| 38 |
+
"removed_ratio": null,
|
| 39 |
+
"missing_parent_count": null
|
| 40 |
+
},
|
| 41 |
+
"wallstreetbets": {
|
| 42 |
+
"posts": null,
|
| 43 |
+
"comments": null,
|
| 44 |
+
"post_date_range_utc": [
|
| 45 |
+
null,
|
| 46 |
+
null
|
| 47 |
+
],
|
| 48 |
+
"comment_date_range_utc": [
|
| 49 |
+
null,
|
| 50 |
+
null
|
| 51 |
+
],
|
| 52 |
+
"max_depth": null,
|
| 53 |
+
"depth_distribution": null,
|
| 54 |
+
"deleted_ratio": null,
|
| 55 |
+
"removed_ratio": null,
|
| 56 |
+
"missing_parent_count": null
|
| 57 |
+
},
|
| 58 |
+
"SkincareAddiction": {
|
| 59 |
+
"posts": null,
|
| 60 |
+
"comments": null,
|
| 61 |
+
"post_date_range_utc": [
|
| 62 |
+
null,
|
| 63 |
+
null
|
| 64 |
+
],
|
| 65 |
+
"comment_date_range_utc": [
|
| 66 |
+
null,
|
| 67 |
+
null
|
| 68 |
+
],
|
| 69 |
+
"max_depth": null,
|
| 70 |
+
"depth_distribution": null,
|
| 71 |
+
"deleted_ratio": null,
|
| 72 |
+
"removed_ratio": null,
|
| 73 |
+
"missing_parent_count": null
|
| 74 |
+
}
|
| 75 |
+
},
|
| 76 |
+
"statistic_definitions": {
|
| 77 |
+
"deleted_ratio": "comments whose body is exactly [deleted] / total comments; null if not measured or denominator is zero",
|
| 78 |
+
"removed_ratio": "comments whose body is exactly [removed] / total comments; null if not measured or denominator is zero",
|
| 79 |
+
"depth_distribution": "mapping from depth to comment count",
|
| 80 |
+
"unknown_values": "null means not measured; it is not an empty or successfully collected batch"
|
| 81 |
+
}
|
| 82 |
+
}
|