def text2vec(self, text):
    '\n        转标签为oneHot编码\n        :param text: str\n        :return: numpy.array\n        '
    text_len = len(text)
    if (text_len > self.max_captcha):
        raise ValueError('验证码最长{}个字符'.format(self.max_captcha))
    vector = np.zeros((self.max_captcha * self.char_set_len))
    for (i, ch) in enumerate(text):
        idx = ((i * self.char_set_len) + self.char_set.index(ch))
        vector[idx] = 1
    return vector
转标签为oneHot编码
:param text: str
:return: numpy.array
def text2vec(self, text):
    '\n        转标签为oneHot编码\n        :param text: str\n        :return: numpy.array\n        '
    text_len = len(text)
    if (text_len > self.max_captcha):
        raise ValueError('验证码最长{}个字符'.format(self.max_captcha))
    vector = np.zeros((self.max_captcha * self.char_set_len))
    for (i, ch) in enumerate(text):
        idx = ((i * self.char_set_len) + self.char_set.index(ch))
        vector[idx] = 1
    return vector