KaraKaraWitch commited on
Commit
654c368
·
verified ·
1 Parent(s): c408c85

Upload NOTES.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. NOTES.md +62 -0
NOTES.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Notes
2
+
3
+ These are general notes of the entire process from processing to semi-final results.
4
+
5
+ # Filtering Steps
6
+
7
+ ## Unpacking (RedditUnpack.py)
8
+
9
+ 1. Run `python RedditUnpack.py process <submissions/comments> <ZST folder> <Output Prefix>` to process submissions and comments respectively.
10
+ - 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.
11
+
12
+ ## Filtering Subreddits (RedditSubredditIndex.py)
13
+
14
+ We don't want really empty subreddits so we prune subreddits by subscriber count first.
15
+
16
+ 2. Run `python RedditSubredditIndex.py preindex <Submissions Output Folder>`
17
+ - This is a very simple counter to get the subscriber counts for each subreddit for each month.
18
+ - This additionally creates a folder called `IndexSubReddit` as a scratch folder for indexing subreddits.
19
+
20
+ 3. Run `python RedditSubredditIndex.py combine`
21
+ - Combines the multiple jsonl files created into a seperate process into 1 massive file.
22
+ - Deduplication via subreddit name matching.
23
+ - Fixes some weird inconsistencies in pushshift dumps.
24
+ - Get's the highest subscriber count seen. Ignores a decrease in subscriber counts.
25
+ - Could be suspectable to sub manipulation, but you need a lot of user accounts to spam for it.
26
+
27
+ 4. (Optional) `python RedditSubredditIndex.py percentile` to get a printout of percentiles: [95th, 90th, 75th, 50th, 25th, 10th, 5th].
28
+ - Not required step but a good way to see which subscriber counts is best suited for your usecase.
29
+
30
+ 5. `python RedditSubredditIndex.py selection <Minimum Subscribers>` to create `sub_selects.jsonl`.
31
+ - Writes a file called `sub_selects.jsonl` containing a jsonl list of selected subreddits.
32
+
33
+ 6. `python RedditSubredditIndex.py filter-folder <Comment/Submission Folder> <Output Folder> <"Submission"/"Comments" (Mode)>`
34
+ - This is the folder known internally as subreddits_M700 / M700 Folder.
35
+ - Point the `<Output Folder>` to the same folder.
36
+ - This will raise an exception when a wrong folder is selected (Comments when the Mode is not selected as Comments, etc.)
37
+ - Don't open the output folder in vscode since vscode will just die trying to see all the jsonl files.
38
+
39
+ # Roughly Filtering (RedditSubredditIndex.py)
40
+
41
+ Even after filtering by subreddit count, we are still left with subreddits which are mostly "Empty" or with a lot of spam.
42
+
43
+ 7. `RedditScoring.py compute-scores <M700 Folder>` computes the some statistics for both submissions:
44
+ - QScores such as Engagement, Richness and Diversity
45
+ - Unique Submission/Comment Authors and submission/comment counts
46
+ 8. Run `RedditScoring.py merge-stats <M700 Folder> <Merged Stats Jsonl>`
47
+ - Merge jsonl files into 1 bigger consolidated stats file.
48
+ 9. `RedditScoring.py makefilter StatsM700.jsonl <Selection-OUTPUT> --mode <text/media>`
49
+ -
50
+
51
+ # Rewrite and Merge submissions, comments into conversations (RedditThreader.py)
52
+
53
+ 10. Run `RedditThreader.py folder subreddits_M700 <OUTPUT_FOLDER> <Selection-OUTPUT>`
54
+ - Rethreads submissions and comments into threads
55
+ - Thread & a bit of additional subreddit filtering is applied.
56
+
57
+ # Uploading to HF
58
+
59
+ 11. Run `RedditChunking.py`
60
+ - Very quick script to chunk all subreddits into jsonl chunks of 10GiB each for upload
61
+ 12. Upload Chunks
62
+ - Uploaded the files.