ZoneTwelve
commited on
Commit
•
4e2027c
1
Parent(s):
81e74d9
Add the original dataset from [bilibot](https://github.com/linyiLYi/bilibot)
Browse files- loader.py +23 -0
- original/test.jsonl +0 -0
- original/train.jsonl +0 -0
- original/valid.jsonl +0 -0
loader.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
# Define the version
|
4 |
+
version = 'original' # latest version of this dataset
|
5 |
+
|
6 |
+
# Load the dataset with version control
|
7 |
+
dataset = load_dataset('json', data_files={'train': 'original/train.jsonl',
|
8 |
+
'validation': 'original/valid.jsonl',
|
9 |
+
'test': 'original/test.jsonl'},
|
10 |
+
version=version)
|
11 |
+
|
12 |
+
# Access the data
|
13 |
+
train_dataset = dataset['train']
|
14 |
+
valid_dataset = dataset['validation']
|
15 |
+
test_dataset = dataset['test']
|
16 |
+
|
17 |
+
# Example usage
|
18 |
+
for example in train_dataset:
|
19 |
+
print(example['text'])
|
20 |
+
break
|
21 |
+
|
22 |
+
# Get the dataset version
|
23 |
+
print(f"Dataset version: {dataset.version}")
|
original/test.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
original/train.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
original/valid.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|