Datasets:

Modalities:
Text
Formats:
csv
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
File size: 4,437 Bytes
3f1c548
 
abf98c4
 
 
 
 
 
 
 
 
 
 
3f1c548
abf98c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3ee264
abf98c4
a3ee264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
abf98c4
 
 
 
 
cbc2e3c
abf98c4
81e0d93
 
abf98c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3ee264
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
license: bsd-2-clause
task_categories:
- text-generation
language:
- en
size_categories:
- 1M<n<10M
configs:
- config_name: default
  data_files:
  - split: train
    path: "shakespeare.csv"
---
# Dataset Card for Dataset Name

This dataset is a part of the [LEAF](https://leaf.cmu.edu/) benchmark. 
The Shakespeare dataset is built from [The Complete Works of William Shakespeare](https://www.gutenberg.org/ebooks/100) with the goal of the next character prediction.

## Dataset Details

### Dataset Description

Each sample is comprised of a text of 80 characters (x) and a next character (y). 

- **Curated by:** [LEAF](https://leaf.cmu.edu/)
- **Language(s) (NLP):** English
- **License:** BSD 2-Clause License

### Dataset Sources

The code from the original repository was adopted to post it here. 

- **Repository:** https://github.com/TalwalkarLab/leaf
- **Paper:** https://arxiv.org/abs/1812.01097

## Uses

This dataset is intended to be used in Federated Learning settings. 
A pair of a character and a play  denotes a unique user in the federation.

### Direct Use
This dataset is designed to be used in FL settings. We recommend using [Flower Dataset](https://flower.ai/docs/datasets/) (flwr-datasets) and [Flower](https://flower.ai/docs/framework/) (flwr).

To partition the dataset, do the following. 
1. Install the package.
```bash
pip install flwr-datasets
```
2. Use the HF Dataset under the hood in Flower Datasets.
```python
from flwr_datasets import FederatedDataset
from flwr_datasets.partitioner import NaturalIdPartitioner

fds = FederatedDataset(
    dataset="flwrlabs/shakespeare",
    partitioners={"train": NaturalIdPartitioner(partition_by="character_id")}
)
partition = fds.load_partition(node_id=0)
```

## Dataset Structure

The dataset contains only train split. The split in the paper happens at each node only (no centralized dataset). 
The dataset is comprised of columns: 
* `character_id`: str - id denoting a pair of character + play (node in federated learning settings)
* `x`: str - text of 80 characters
* `y`: str - single character following the `x`

Please note that the data is temporal. Therefore, caution is needed when dividing it so as not to leak the information from the train set.

## Dataset Creation

### Curation Rationale

This dataset was created as a part of the [LEAF](https://leaf.cmu.edu/) benchmark.

### Source Data

[The Complete Works of William Shakespeare](https://www.gutenberg.org/ebooks/100)

#### Data Collection and Processing

For the preprocessing details, please refer to the original paper and the source code.

#### Who are the source data producers?

William Shakespeare

## Citation

When working on the LEAF benchmark, please cite the original paper. If you're using this dataset with Flower Datasets, you can cite Flower.

**BibTeX:**
```
@article{DBLP:journals/corr/abs-1812-01097,
  author       = {Sebastian Caldas and
                  Peter Wu and
                  Tian Li and
                  Jakub Kone{\v{c}}n{\'y} and
                  H. Brendan McMahan and
                  Virginia Smith and
                  Ameet Talwalkar},
  title        = {{LEAF:} {A} Benchmark for Federated Settings},
  journal      = {CoRR},
  volume       = {abs/1812.01097},
  year         = {2018},
  url          = {http://arxiv.org/abs/1812.01097},
  eprinttype    = {arXiv},
  eprint       = {1812.01097},
  timestamp    = {Wed, 23 Dec 2020 09:35:18 +0100},
  biburl       = {https://dblp.org/rec/journals/corr/abs-1812-01097.bib},
  bibsource    = {dblp computer science bibliography, https://dblp.org}
}
```
```
@article{DBLP:journals/corr/abs-2007-14390,
  author       = {Daniel J. Beutel and
                  Taner Topal and
                  Akhil Mathur and
                  Xinchi Qiu and
                  Titouan Parcollet and
                  Nicholas D. Lane},
  title        = {Flower: {A} Friendly Federated Learning Research Framework},
  journal      = {CoRR},
  volume       = {abs/2007.14390},
  year         = {2020},
  url          = {https://arxiv.org/abs/2007.14390},
  eprinttype    = {arXiv},
  eprint       = {2007.14390},
  timestamp    = {Mon, 03 Aug 2020 14:32:13 +0200},
  biburl       = {https://dblp.org/rec/journals/corr/abs-2007-14390.bib},
  bibsource    = {dblp computer science bibliography, https://dblp.org}
}
```

## Dataset Card Contact

In case of any doubts, please contact [Flower Labs](https://flower.ai/).