--- configs: - config_name: default data_files: - split: train path: "pushshift_*/**/*.parquet" --- # ๐Ÿš€ Cleaned Reddit Pushshift Dataset (Parquet) ## ๐Ÿ“– Dataset Description This dataset is a highly optimized, meticulously cleaned, and structured version of the raw Reddit Pushshift dump. It has been transformed from massive `.zst` compressed JSON files into highly efficient, columnar **Parquet** files, making it immediately ready for Big Data analytics, SQL querying (via DuckDB), and Large Language Model (LLM) training. The dataset includes both Reddit **Submissions** (Posts) and **Comments**. ## ๐Ÿงน Data Cleaning & Preprocessing Pipeline Unlike the raw Pushshift dump which contains heavy noise, this dataset has been processed through a strict ETL pipeline: 1. **Dead Data Removal:** - Completely dropped rows where the `author`, `selftext`, or `body` is `[deleted]`, `[removed]`, or `None`. - Dropped comments missing essential relation links (`link_id`, `parent_id`). 2. **Noise & Encoding Fixes:** - Filtered out submissions containing severe Unicode/font errors (e.g., `\ufffd` characters). 3. **Data Type Normalization:** - Converted raw Unix timestamps (`created_utc`) into readable `YYYY-MM-DD` string format. - Safely cast numerical fields (`score`, `num_comments`, `upvote_ratio`, etc.) to strict Integer/Float types to prevent schema crashing. - Handled missing text fields by filling them with `"None"` to ensure consistent string types. 4. **NSFW & Sensitive Content Filtering:** - Applied a smart Regex and CamelCase keyword filter to automatically identify and exclude highly sensitive or purely NSFW subreddits from the repository. 5. **Storage Optimization (The "Small File" Fix):** - Micro-files (under 1MB) representing inactive subreddits were skipped. This prevents the "Small File Problem" in Parquet storage, ensuring the Hugging Face Data Viewer and distributed computing frameworks (like Apache Spark) run at lightning speed. ## ๐Ÿ—‚๏ธ Dataset Structure (Schema) ### ๐Ÿ“ Submissions (Posts) | Field | Type | Description | | :--- | :--- | :--- | | `author` | string | The Reddit username of the poster. | | `name` | string | Unique base36 ID of the submission (e.g., t3_xxx). | | `title` | string | The title of the post. | | `selftext` | string | The text body of the post. | | `created_utc` | string | Date of creation (YYYY-MM-DD). | | `score` | int64 | Net upvotes minus downvotes. | | `upvote_ratio` | float64 | Ratio of upvotes to total votes. | | `num_comments` | int64 | Number of comments on the thread. | | `num_crossposts` | int64 | Number of times the post was crossposted. | | `subreddit` | string | Name of the subreddit. | | `subreddit_id` | string | Unique ID of the subreddit. | | `subreddit_subscribers`| int64 | Number of members in the subreddit. | | `domain` | string | The domain of the link submitted (if any). | | `crosspost_parent` | string | ID of the parent post if this is a crosspost. | ### ๐Ÿ’ฌ Comments | Field | Type | Description | | :--- | :--- | :--- | | `author` | string | The Reddit username of the commenter. | | `name` | string | Unique base36 ID of the comment (e.g., t1_xxx). | | `body` | string | The text content of the comment. | | `created_utc` | string | Date of creation (YYYY-MM-DD). | | `score` | int64 | Net upvotes minus downvotes. | | `controversiality` | int64 | Reddit's controversiality metric (0 or 1). | | `parent_id` | string | The ID of the comment/post this is replying to. | | `link_id` | string | The ID of the parent submission. | | `subreddit` | string | Name of the subreddit. | | `subreddit_id` | string | Unique ID of the subreddit. | ## ๐Ÿ’ป How to Use You can easily load this dataset using the Hugging Face `datasets` library. Since it's stored in Parquet, it will stream efficiently. ```python from datasets import load_dataset # Load the dataset (Streaming mode is recommended due to massive size) dataset = load_dataset("anhchanghoangsg/reddit_pushshift_dataset_cleaned", streaming=True) # Print the first row of the train split print(next(iter(dataset['train'])))