Dataset Viewer
text
stringclasses 1
value |
|---|
"First Citizen:\nBefore we proceed any further, hear me speak.\n\nAll:\nSpeak, speak.\n\nFirst Citiz(...TRUNCATED) |
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:
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.
- Downloads last month
- 20