tiny_shakespeare

  • 説明:

シェイクスピアのさまざまな戯曲から、シェイクスピアの 40,000 行。 Andrej Karpathy のブログ記事「リカレント ニューラル ネットワークの不当な有効性」で取り上げられています: http://karpathy.github.io/2015/05/21/rnn-effectiveness/

キャラクターモデリングなどに使用するには:

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)
スプリット
'test' 1
'train' 1
'validation' 1
  • 機能構造:
FeaturesDict({
   
'text': Text(shape=(), dtype=string),
})
  • 機能のドキュメント:
特徴クラスDtype説明
特徴辞書
文章文章
  • 引用
@misc{
  author
={Karpathy, Andrej},
  title
={char-rnn},
  year
={2015},
  howpublished
={\url{https://github.com/karpathy/char-rnn} }
}
,

  • 説明:

シェイクスピアのさまざまな戯曲から、シェイクスピアの 40,000 行。 Andrej Karpathy のブログ記事「リカレント ニューラル ネットワークの不当な有効性」で取り上げられています: http://karpathy.github.io/2015/05/21/rnn-effectiveness/

キャラクターモデリングなどに使用するには:

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)
スプリット
'test' 1
'train' 1
'validation' 1
  • 機能構造:
FeaturesDict({
   
'text': Text(shape=(), dtype=string),
})
  • 機能のドキュメント:
特徴クラスDtype説明
特徴辞書
文章文章
  • 引用
@misc{
  author
={Karpathy, Andrej},
  title
={char-rnn},
  year
={2015},
  howpublished
={\url{https://github.com/karpathy/char-rnn} }
}