File size: 1,681 Bytes
434df7c
bb8b5d3
 
 
 
 
 
 
 
 
 
 
1d0df5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434df7c
bb8b5d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- en
license: cc0-1.0
task_categories:
- text-generation
pretty_name: Shakespeare Complete Works - Dialogue Format
tags:
- shakespeare
- dialogue
- drama
- literature
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
dataset_info:
  features:
  - name: text
    dtype: string
  splits:
  - name: train
    num_bytes: 1115398
    num_examples: 1
  download_size: 704060
  dataset_size: 1115398
---

Taken from Andrej Karpathy and repurposed for UofT's CSC 413 Deep Learning 
40,000 lines of Shakespeare from a variety of Shakespeare's plays. Featured in Andrej Karpathy's blog post 'The Unreasonable Effectiveness of Recurrent Neural Networks': http://karpathy.github.io/2015/05/21/rnn-effectiveness/.



## Usage

To use for e.g. character modelling:

```python
from datasets import load_dataset

# Load the dataset
dataset = load_dataset("r-three/shakespeare-dialogue-blob")

# Access examples
for example in dataset['train'][:5]:
    print(f"{example['character']}: {example['text']}")

# Filter by character
hamlet_lines = dataset['train'].filter(lambda x: x['character'] == 'Hamlet')

# Get character statistics
from collections import Counter
characters = Counter(dataset['train']['character'])
print(f"Top 10 characters: {characters.most_common(10)}")
```

## Source

Public domain works by William Shakespeare, sourced from the Karpathy char-rnn repository.

To cite:
```
@misc{
  author={Karpathy, Andrej},
  title={char-rnn},
  year={2015},
  howpublished={\url{https://github.com/karpathy/char-rnn}}
}
```


## License

This dataset is in the public domain (CC0-1.0) as Shakespeare's works are no longer under copyright.