I am not sure what the problem us being new to using keera's
Code:
embedding_matrix = np.random.random((len(word_index) + 1, EMBEDDING_DIM))
for word, i in word_index.items():
embedding_vector = embeddings_index.get(word)
if embedding_vector is not None:
words not found in embedding index will be all-zeros.
Stack Trace:
[141. 243.]
[ 76. 164.]
[ 88. 152.]
Total 27995 word vectors in Glove.
Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users//Desktop/LSTM/SLSTM.py', wdir='C:/Users//Desktop/LSTM')
File "C:\Users\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
execfile(filename, namespace)
File "C:\Users\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users//Desktop/LSTM/SLSTM.py", line 111, in
embedding_matrix[i] = (embedding_vector)
ValueError: could not broadcast input array from shape (300) into shape (100)
I am not sure what the problem us being new to using keera's
Code: embedding_matrix = np.random.random((len(word_index) + 1, EMBEDDING_DIM)) for word, i in word_index.items(): embedding_vector = embeddings_index.get(word) if embedding_vector is not None:
words not found in embedding index will be all-zeros.
embedding_layer = Embedding(len(word_index) + 1, EMBEDDING_DIM, weights=[embedding_matrix], input_length=MAX_SEQUENCE_LENGTH)
Stack Trace: [141. 243.] [ 76. 164.] [ 88. 152.] Total 27995 word vectors in Glove. Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users//Desktop/LSTM/SLSTM.py', wdir='C:/Users//Desktop/LSTM')
File "C:\Users\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile execfile(filename, namespace)
File "C:\Users\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users//Desktop/LSTM/SLSTM.py", line 111, in
embedding_matrix[i] = (embedding_vector)
ValueError: could not broadcast input array from shape (300) into shape (100)