gaussic / text-classification-cnn-rnn

CNN-RNN中文文本分类,基于TensorFlow
MIT License
4.16k stars 1.47k forks source link

embedding嵌入词向量实现过程是怎样的 #131

Closed dc0107 closed 5 years ago

dc0107 commented 5 years ago

embedding = tf.get_variable('embedding', [self.config.vocab_size, self.config.embedding_dim]) embedding_inputs = tf.nn.embedding_lookup(embedding, self.input_x) embedding被get_variable初始化成一个随机的数据,怎么tf.nn.embedding_lookup(embedding, self.input_x)用输入的onehot值建立对应关系的