Categories
Development

indices do not match while training Sequential model

I followed all the code as I found on this site:

https://appliedmachinelearning.blog/2019/10/31/event-vs-non-event-classification-in-financial-documents-text-classification/

But getting an error at this line:

model.fit(train_X, y_train, epochs=10, batch_size=32)

InvalidArgumentError:  indices[12,78] = 4291 is not in [0, 4000)
     [[node embedding_1/embedding_lookup (defined at /opt/conda/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1751) ]] [Op:__inference_keras_scratch_graph_1942]

Function call stack:
keras_scratch_graph

The full code is available here:

https://github.com/shantanuo/stack_question/blob/master/nlp.ipynb

Leave a Reply

Your email address will not be published. Required fields are marked *