ierhon commited on
Commit
8ceb723
·
1 Parent(s): d12bf65

sleepy hon forgot how to use a tokenizer

Browse files
Files changed (1) hide show
  1. train.py +1 -1
train.py CHANGED
@@ -33,7 +33,7 @@ X = [] # we're loading the training data into input X
33
  y = [] # and output y
34
 
35
  for line, key in enumerate(dset):
36
- tokens = tokenizer.tokenize(key)
37
  X.append(numpy.array((list(tokens)+[0,]*inp_len)[:inp_len])) # refusing to use pad_sequences for an unspecified reason and creating the worst line of code
38
  output_array = np.zeros(dset_size)
39
  output_array[line] = 1 # 0 0 0 1 0 0 0 0 0, the neuron of the each line activates in the correct response
 
33
  y = [] # and output y
34
 
35
  for line, key in enumerate(dset):
36
+ tokens = tokenizer.texts_to_sequences([key,])[0]
37
  X.append(numpy.array((list(tokens)+[0,]*inp_len)[:inp_len])) # refusing to use pad_sequences for an unspecified reason and creating the worst line of code
38
  output_array = np.zeros(dset_size)
39
  output_array[line] = 1 # 0 0 0 1 0 0 0 0 0, the neuron of the each line activates in the correct response