<br />

- **Description**:

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/>

To use for e.g. character modelling:

    d = tfds.load(name='tiny_shakespeare')['train']
    d = d.map(lambda x: tf.strings.unicode_split(x['text'], 'UTF-8'))
    # train split includes vocabulary for other splits
    vocabulary = sorted(set(next(iter(d)).numpy()))
    d = d.map(lambda x: {'cur_char': x[:-1], 'next_char': x[1:]})
    d = d.unbatch()
    seq_len = 100
    batch_size = 2
    d = d.batch(seq_len)
    d = d.batch(batch_size)

- **Homepage** :
  <https://github.com/karpathy/char-rnn/blob/master/data/tinyshakespeare/input.txt>

- **Source code** :
  [`tfds.datasets.tiny_shakespeare.Builder`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/datasets/tiny_shakespeare/tiny_shakespeare_dataset_builder.py)

- **Versions**:

  - **`1.0.0`** (default): No release notes.
- **Download size** : `1.06 MiB`

- **Dataset size** : `1.06 MiB`

- **Auto-cached**
  ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):
  Yes

- **Splits**:

| Split | Examples |
|---|---|
| `'test'` | 1 |
| `'train'` | 1 |
| `'validation'` | 1 |

- **Feature structure**:

    FeaturesDict({
        'text': Text(shape=(), dtype=string),
    })

- **Feature documentation**:

| Feature | Class | Shape | Dtype | Description |
|---|---|---|---|---|
|   | FeaturesDict |   |   |   |
| text | Text |   | string |   |

- **Supervised keys** (See
  [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):
  `None`

- **Figure**
  ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):
  Not supported.

- **Examples**
  ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

<iframe src="https:///frame/datasets/catalog/tiny_shakespeare_efc5de28517a2b1a16b52684a718f2357abdfbbd7484ca6c593da05ef745f072.frame" class="framebox inherit-locale " allow="clipboard-write https://" allowfullscreen is-upgraded></iframe>

- **Citation**:

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