from sklearn import preprocessing
labels = ['我','你','他','我']
print('分类标签的数字化:')
label_encoder = preprocessing.LabelEncoder()
int_labels = label_encoder.fit_transform(labels)
#打印将所有标签数字化后的后果
print(int_labels)
print('分类标签的向量化:')
from keras.utils import np_utils
label_vecs = np_utils.to_categorical(int_labels)
print(label_vecs)