I Have 1D list float values for instance [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.3125, 0.25]. I want to train LSTM model in which I have the details in the form of list and getting error Failed to convert a NumPy array to a Tensor (Unsupported object type list).
enter code here
sentiment Trigram_value
0 positive [0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0....
1 positive [-0.1875, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0...
2 positive [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, ...
3 negative [0.0, 0.0, 0.0, 0.0, -0.1875, 0.0, 0.0, 0.0, 0...
4 positive [0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ...
50000 rows × 2 columns
The model Structure is mentioned below.
embedding_vecor_length = 100
model = Sequential()
model.add(Embedding(vocab_size, embedding_vecor_length,
input_length=maxlen))
model.add(LSTM(64, dropout=0.2, recurrent_dropout=0.2))
model.add(Dense(250,activation='softmax'))
model.add(Flatten())
model.add(Dense(1, activation='sigmoid'))
model.summary()