Notes
These are general notes of the entire process from processing to semi-final results.
Filtering Steps
Unpacking (RedditUnpack.py)
- Run
python RedditUnpack.py process <submissions/comments> <ZST folder> <Output Prefix>
to process submissions and comments respectively.
- This unpacks submissions and comments into jsonl files. Expanding them to ~8TiB uncompressed. So be sure to have plenty of storage or some sort of disk compression.
Filtering Subreddits (RedditSubredditIndex.py)
We don't want really empty subreddits so we prune subreddits by subscriber count first.
- Run
python RedditSubredditIndex.py preindex <Submissions Output Folder>
- This is a very simple counter to get the subscriber counts for each subreddit for each month.
- This additionally creates a folder called
IndexSubReddit
as a scratch folder for indexing subreddits.
- Run
python RedditSubredditIndex.py combine
- Combines the multiple jsonl files created into a seperate process into 1 massive file.
- Deduplication via subreddit name matching.
- Fixes some weird inconsistencies in pushshift dumps.
- Get's the highest subscriber count seen. Ignores a decrease in subscriber counts.
- Could be suspectable to sub manipulation, but you need a lot of user accounts to spam for it.
- (Optional)
python RedditSubredditIndex.py percentile
to get a printout of percentiles: [95th, 90th, 75th, 50th, 25th, 10th, 5th].
- Not required step but a good way to see which subscriber counts is best suited for your usecase.
python RedditSubredditIndex.py selection <Minimum Subscribers>
to createsub_selects.jsonl
.
- Writes a file called
sub_selects.jsonl
containing a jsonl list of selected subreddits.
python RedditSubredditIndex.py filter-folder <Comment/Submission Folder> <Output Folder> <"Submission"/"Comments" (Mode)>
- This is the folder known internally as subreddits_M700 / M700 Folder.
- Point the
<Output Folder>
to the same folder. - This will raise an exception when a wrong folder is selected (Comments when the Mode is not selected as Comments, etc.)
- Don't open the output folder in vscode since vscode will just die trying to see all the jsonl files.
Roughly Filtering (RedditSubredditIndex.py)
Even after filtering by subreddit count, we are still left with subreddits which are mostly "Empty" or with a lot of spam.
RedditScoring.py compute-scores <M700 Folder>
computes the some statistics for both submissions:
- QScores such as Engagement, Richness and Diversity
- Unique Submission/Comment Authors and submission/comment counts
- Run
RedditScoring.py merge-stats <M700 Folder> <Merged Stats Jsonl>
- Merge jsonl files into 1 bigger consolidated stats file.
RedditScoring.py makefilter StatsM700.jsonl <Selection-OUTPUT> --mode <text/media>
-
Rewrite and Merge submissions, comments into conversations (RedditThreader.py)
- Run
RedditThreader.py folder subreddits_M700 <OUTPUT_FOLDER> <Selection-OUTPUT>
- Rethreads submissions and comments into threads
- Thread & a bit of additional subreddit filtering is applied.
Uploading to HF
- Run
RedditChunking.py
- Very quick script to chunk all subreddits into jsonl chunks of 10GiB each for upload
- Upload Chunks
- Uploaded the files.