在最新的TensorFlow中,tf.contrib.layers.embed_sequence()
用于对固定长度的文本进行分类。
我想知道RNN是否可以对变长文本进行分类?
TensorFlow中有没有相关的API?
谢谢!
回答:
这在当前的API文档中没有说明。如果你需要处理变长文本,可以选择一个较大的长度并填充你的句子。
embed_sequence(ids, vocab_size=None, embed_dim=None, unique=False, initializer=None, regularizer=None, trainable=True, scope=None, reuse=None)
要查看源代码中的注释和说明,请点击这里。
你可能会发现这些链接有用:TensorFlow中的变长序列,使用TensorFlow的RNN处理变长句子