ben-epstein commited on
Commit
2bb2fe7
·
1 Parent(s): fc18fb1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -5
README.md CHANGED
@@ -1,4 +1,11 @@
1
  ---
 
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: label
@@ -12,15 +19,37 @@ dataset_info:
12
  - name: content
13
  dtype: string
14
  splits:
15
- - name: test
16
- num_bytes: 18182813
17
- num_examples: 40000
18
  - name: train
19
  num_bytes: 163359702
20
  num_examples: 360000
 
 
 
21
  download_size: 120691417
22
  dataset_size: 181542515
23
  ---
24
- # Dataset Card for "amazon_polarity_10_pct"
25
 
26
- [More Information needed](https://github.com/huggingface/datasets/blob/main/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ configs:
3
+ - config_name: default
4
+ data_files:
5
+ - split: train
6
+ path: data/train-*
7
+ - split: test
8
+ path: data/test-*
9
  dataset_info:
10
  features:
11
  - name: label
 
19
  - name: content
20
  dtype: string
21
  splits:
 
 
 
22
  - name: train
23
  num_bytes: 163359702
24
  num_examples: 360000
25
+ - name: test
26
+ num_bytes: 18182813
27
+ num_examples: 40000
28
  download_size: 120691417
29
  dataset_size: 181542515
30
  ---
 
31
 
32
+ # Amazon Polarity 10pct
33
+
34
+ This is a direct subset of the original [Amazon Polarity](https://huggingface.co/datasets/amazon_polarity) dataset, downsampled 10pct with a random shuffle
35
+
36
+ ### Dataset Summary
37
+
38
+ For quicker testing on Amazon Polarity. See https://huggingface.co/datasets/amazon_polarity for details and attributions
39
+
40
+
41
+ ### Source Data
42
+ ```python
43
+ from datasets import ClassLabel, Dataset, DatasetDict, load_dataset
44
+
45
+ ds_full = load_dataset("amazon_polarity", streaming=True)
46
+ ds_train_10_pct = Dataset.from_list(list(ds_full["train"].shuffle(seed=42).take(360_000)))
47
+ ds_test_10_pct = Dataset.from_list(list(ds_full["test"].shuffle(seed=42).take(40_000)))
48
+
49
+ ds_10_pct = DatasetDict({"train": ds_train_10_pct, "test": ds_test_10_pct})
50
+ # Need to recreate the class labels
51
+ class_label = ClassLabel(num_classes=2, names=["negative", "positive"])
52
+ ds_10_pct = ds_10_pct.map(lambda row: {"title": row["title"], "content": row["content"], "label": "negative" if not row["label"] else "positive"})
53
+ ds_10_pct = ds_10_pct.cast_column("label", class_label)
54
+ ```
55
+