一种热编码为keras中的不同单词提供相同的编号 [英] One Hot Encoding giving same number for different words in keras

查看:58
本文介绍了一种热编码为keras中的不同单词提供相同的编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我用不同的词得到相同的结果?

Why I am getting same results for different words?

import keras
keras.__version__
'1.0.0'
import theano 
theano.__version__
'0.8.1'

from keras.preprocessing.text import one_hot
one_hot('START', 43)
[26]
one_hot('children', 43)
[26]

推荐答案

通过一种热编码方式无法保证统一性

unicity non-guaranteed in one hot encoding

请参见一个热门的keras文档

这篇关于一种热编码为keras中的不同单词提供相同的编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆