albertvillanova HF staff commited on
Commit
97be861
1 Parent(s): 0bbf9e4

Convert dataset to Parquet (#3)

Browse files

- Convert dataset to Parquet (4052ec66fb17e6dd1c2cc71b3b81656101eae0c9)
- Delete loading script (182be44e22df9e0ce1ebdae57245a3a50f708f89)

README.md CHANGED
@@ -1,7 +1,6 @@
1
  ---
2
  language:
3
  - en
4
- paperswithcode_id: null
5
  pretty_name: CrimeAndPunish
6
  dataset_info:
7
  features:
@@ -9,10 +8,15 @@ dataset_info:
9
  dtype: string
10
  splits:
11
  - name: train
12
- num_bytes: 1270540
13
  num_examples: 21969
14
- download_size: 1201735
15
- dataset_size: 1270540
 
 
 
 
 
16
  ---
17
 
18
  # Dataset Card for "crime_and_punish"
 
1
  ---
2
  language:
3
  - en
 
4
  pretty_name: CrimeAndPunish
5
  dataset_info:
6
  features:
 
8
  dtype: string
9
  splits:
10
  - name: train
11
+ num_bytes: 1265042
12
  num_examples: 21969
13
+ download_size: 786381
14
+ dataset_size: 1265042
15
+ configs:
16
+ - config_name: default
17
+ data_files:
18
+ - split: train
19
+ path: data/train-*
20
  ---
21
 
22
  # Dataset Card for "crime_and_punish"
crime_and_punish.py DELETED
@@ -1,59 +0,0 @@
1
- import datasets
2
-
3
-
4
- _DESCRIPTION = """\
5
-
6
- """
7
- _URL = "https://www.gutenberg.org/files/2554/2554-h/2554-h.htm"
8
- _DATA_URL = "https://raw.githubusercontent.com/patrickvonplaten/datasets/master/crime_and_punishment.txt"
9
-
10
-
11
- class CrimeAndPunish(datasets.GeneratorBasedBuilder):
12
- def _info(self):
13
- return datasets.DatasetInfo(
14
- # This is the description that will appear on the datasets page.
15
- description=_DESCRIPTION,
16
- # datasets.features.FeatureConnectors
17
- features=datasets.Features(
18
- {
19
- "line": datasets.Value("string"),
20
- }
21
- ),
22
- # If there's a common (input, target) tuple from the features,
23
- # specify them here. They'll be used if as_supervised=True in
24
- # builder.as_dataset.
25
- supervised_keys=None,
26
- homepage=_URL,
27
- )
28
-
29
- def _split_generators(self, dl_manager):
30
- """Returns SplitGenerators."""
31
-
32
- data = dl_manager.download_and_extract(_DATA_URL)
33
-
34
- return [
35
- datasets.SplitGenerator(
36
- name=datasets.Split.TRAIN,
37
- gen_kwargs={"data_file": data, "split": "train"},
38
- ),
39
- ]
40
-
41
- def _generate_examples(self, data_file, split):
42
-
43
- with open(data_file, "rb") as f:
44
- id_counter = 0
45
- add_text = False
46
- crime_and_punishment_occ_counter = 0
47
-
48
- for line in f:
49
- line = line.decode("UTF-8")
50
- if "CRIME AND PUNISHMENT" in line:
51
- crime_and_punishment_occ_counter += 1
52
- add_text = crime_and_punishment_occ_counter == 3
53
- if "End of Project" in line:
54
- add_text = False
55
-
56
- if add_text is True:
57
- result = {"line": line}
58
- id_counter += 1
59
- yield id_counter, result
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5c03b8287cb54f62ce06c08f345df16102617c69900063073b5f80bc05703a8
3
+ size 786381