File size: 840 Bytes
f0b005d
 
 
 
 
 
 
 
 
 
 
 
06124c0
f0b005d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse

from datasets import load_dataset

from project_settings import project_path


def get_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--dataset_path", default="h_novel.py", type=str)
    parser.add_argument("--dataset_name", default="yazhou_20m", type=str)
    parser.add_argument(
        "--dataset_cache_dir",
        default=(project_path / "hub_datasets").as_posix(),
        type=str
    )
    args = parser.parse_args()
    return args


def main():
    args = get_args()

    dataset = load_dataset(
        path=args.dataset_path,
        name=args.dataset_name,
        cache_dir=args.dataset_cache_dir,
    )
    for sample in dataset["train"]:
        print(sample)
        print("-" * 150)

    return


if __name__ == '__main__':
    main()