1 2 3 4 5 6 7 8 9 10 11 12 13 14
| 举例 sentences = ['i love you','do you have money', 'i like running']
word_index {'i': 1, 'you': 2, 'love': 3, 'do': 4, 'have': 5, 'money': 6, 'like': 7, 'running': 8}
sequences [[1, 3, 2], [4, 2, 5, 6], [1, 7, 8]]
padded 默认以最长句子为Maxlen ,在序列前面填充 [[0 1 3 2] [4 2 5 6] [0 1 7 8]]
|