为答案词索引创建标签

时间:2019-05-07 07:14:52

标签: tensorflow keras

我试图按照此博客文章中的说明运行代码。

https://appliedmachinelearning.blog/2019/05/01/developing-factoid-question-answering-system-on-babi-facebook-data-set-python-keras-part-1/

但是收到此错误...

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

这是我实际使用的代码:

https://github.com/shantanuo/pandas_examples/blob/master/tensorflow/factoid_using_bAbI.ipynb

作者正在尝试为答案词索引创建标签1。但是我想语法是错误的。我应该如何纠正此功能?


更新: 本文基于官方的keras示例,该示例在我尝试时按预期工作。但是本文中提到的代码不起作用。

https://github.com/keras-team/keras/blob/master/examples/babi_rnn.py

0 个答案:

没有答案