Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,27 +1,60 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
- name: test
|
| 14 |
-
num_bytes: 278850
|
| 15 |
-
num_examples: 55770
|
| 16 |
-
download_size: 924470
|
| 17 |
-
dataset_size: 5576970
|
| 18 |
-
configs:
|
| 19 |
-
- config_name: default
|
| 20 |
-
data_files:
|
| 21 |
-
- split: train
|
| 22 |
-
path: data/train-*
|
| 23 |
-
- split: validation
|
| 24 |
-
path: data/validation-*
|
| 25 |
-
- split: test
|
| 26 |
-
path: data/test-*
|
| 27 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: cc0-1.0
|
| 5 |
+
task_categories:
|
| 6 |
+
- text-generation
|
| 7 |
+
pretty_name: Shakespeare Complete Works - Dialogue Format
|
| 8 |
+
tags:
|
| 9 |
+
- shakespeare
|
| 10 |
+
- dialogue
|
| 11 |
+
- drama
|
| 12 |
+
- literature
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
+
|
| 15 |
+
Taken from Andrej Karpathy and repurposed for UofT's CSC 413 Deep Learning
|
| 16 |
+
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/.
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
## Usage
|
| 21 |
+
|
| 22 |
+
To use for e.g. character modelling:
|
| 23 |
+
|
| 24 |
+
```python
|
| 25 |
+
from datasets import load_dataset
|
| 26 |
+
|
| 27 |
+
# Load the dataset
|
| 28 |
+
dataset = load_dataset("r-three/shakespeare-dialogue-blob")
|
| 29 |
+
|
| 30 |
+
# Access examples
|
| 31 |
+
for example in dataset['train'][:5]:
|
| 32 |
+
print(f"{example['character']}: {example['text']}")
|
| 33 |
+
|
| 34 |
+
# Filter by character
|
| 35 |
+
hamlet_lines = dataset['train'].filter(lambda x: x['character'] == 'Hamlet')
|
| 36 |
+
|
| 37 |
+
# Get character statistics
|
| 38 |
+
from collections import Counter
|
| 39 |
+
characters = Counter(dataset['train']['character'])
|
| 40 |
+
print(f"Top 10 characters: {characters.most_common(10)}")
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Source
|
| 44 |
+
|
| 45 |
+
Public domain works by William Shakespeare, sourced from the Karpathy char-rnn repository.
|
| 46 |
+
|
| 47 |
+
To cite:
|
| 48 |
+
```
|
| 49 |
+
@misc{
|
| 50 |
+
author={Karpathy, Andrej},
|
| 51 |
+
title={char-rnn},
|
| 52 |
+
year={2015},
|
| 53 |
+
howpublished={\url{https://github.com/karpathy/char-rnn}}
|
| 54 |
+
}
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
## License
|
| 59 |
+
|
| 60 |
+
This dataset is in the public domain (CC0-1.0) as Shakespeare's works are no longer under copyright.
|