MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / RedditDataset

Class RedditDataset

join/Deepjoin/all-mpnet-base-v2/train_script.py:223–237  ·  view source on GitHub ↗

A class that handles the reddit data files

Source from the content-addressed store, hash-verified

221
222
223class RedditDataset:
224 """
225 A class that handles the reddit data files
226 """
227 def __init__(self, filepath):
228 self.filepath = filepath
229
230 def __iter__(self):
231 while True:
232 with gzip.open(self.filepath, "rt") as fIn:
233 for line in fIn:
234 data = json.loads(line)
235
236 if "response" in data and "context" in data:
237 yield [data["response"], data["context"]]
238
239class Dataset:
240 """

Callers 1

produce_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected