sleepy hon forgot how to use a tokenizer
Browse files
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.
|
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
|