Files changed (1) hide show
  1. README.md +4 -10
README.md CHANGED
@@ -62,16 +62,10 @@ dataset_info:
62
  To use for e.g. character modelling:
63
 
64
  ```
65
- d = datasets.load_dataset(name='tiny_shakespeare')['train']
66
- d = d.map(lambda x: datasets.Value('strings').unicode_split(x['text'], 'UTF-8'))
67
- # train split includes vocabulary for other splits
68
- vocabulary = sorted(set(next(iter(d)).numpy()))
69
- d = d.map(lambda x: {'cur_char': x[:-1], 'next_char': x[1:]})
70
- d = d.unbatch()
71
- seq_len = 100
72
- batch_size = 2
73
- d = d.batch(seq_len)
74
- d = d.batch(batch_size)
75
  ```
76
 
77
  ### Supported Tasks and Leaderboards
 
62
  To use for e.g. character modelling:
63
 
64
  ```
65
+ d = datasets.load_dataset('tiny_shakespeare', split='train')
66
+ d = d.map(lambda x: {'tokens': list(x['text'])})
67
+ vocabulary = set(d['tokens'][0])
68
+ print(d['tokens'])
 
 
 
 
 
 
69
  ```
70
 
71
  ### Supported Tasks and Leaderboards