debug_seq2seq
1.0.0
注意:存储库不被维护。如果您想承担维护工作,请随时私信我。
使 keras 的 seq2seq 工作。并尝试一下 seq2seq 的其他一些实现。
代码包括:
警告
文件
漂亮的图片
设置&运行
git clone https://github.com/nicolas-ivanov/debug_seq2seq
cd debug_seq2seq
bash bin/setup.sh
python bin/train.py
进而
python bin/test.py
结果
目前还没有取得好的结果:
[why ?] -> [i ' . . $$$ . $$$ $$$ $$$ $$$ as as as as i i]
[who ?] -> [i ' . . $$$ . $$$ $$$ $$$ $$$ as as as as i i]
[yeah ?] -> [i ' . . $$$ . $$$ $$$ $$$ $$$ as as as as i i]
[what is it ?] -> [i ' . . $$$ . $$$ $$$ $$$ $$$ as as as as as i]
[why not ?] -> [i ' . . $$$ . $$$ $$$ $$$ $$$ as as as as i i]
[really ?] -> [i ' . . $$$ . $$$ $$$ $$$ $$$ as as as as i i]
我的猜测是这种方法存在一些基本问题:
由于 word2vec 向量用于单词表示,并且模型为每个下一个单词返回一个近似向量,因此此错误从一个单词累积到另一个单词,因此从第三个单词开始,模型无法预测任何有意义的内容......这个问题可能是如果我们用“正确”向量(即对应于字典中实际单词的向量)替换每个时间戳的近似 word2vec 向量,则可以克服这一问题。这有道理吗?然而,您需要深入研究 seq2seq 代码才能做到这一点。
第二个问题与单词采样有关:即使您设法解决上述问题,如果您坚持使用 argmax() 来每次时间戳选择最可能的单词,答案也会太简单且无趣,例如:
are you a human? -- no .
are you a robot or human? -- no .
are you a robot? -- no .
are you better than siri? -- yes .
are you here ? -- yes .
are you human? -- no .
are you really better than siri? -- yes .
are you there -- you ' re not going to be
are you there?!?! -- yes .
不要误导您:这些结果是在基于张量流的不同 seq2seq 架构上实现的。
可以使用温度采样以使输出结果多样化,但这同样应该在 seq2seq 库内完成。