Actualización código

parent 7373f811
Showing with 1 additions and 4 deletions
......@@ -121,10 +121,8 @@ def classification_embedings_rnn(tweets_train, tweets_train_labels_numeric, twee
embedding_matrix[index] = embedding_vector
#max_len_input = 30
train_features_pad = sequence.pad_sequences(corpus_train_index, maxlen=max_len_input, padding="post", truncating="post", dtype=type(corpus_train_index[0][0]))
# define RNN model
model = Sequential()
......@@ -139,7 +137,7 @@ def classification_embedings_rnn(tweets_train, tweets_train_labels_numeric, twee
model.add(Dense(len(CLASSES), activation='softmax'))
# compile the model
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['acc'])
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['acc'])
# summarize the model
print(model.summary())
......@@ -175,6 +173,5 @@ def main ():
tweets_dev_classified_labels = classification_embedings_rnn(tweets_train, tweets_train_labels_numeric, tweets_dev)
calculate_quality_performamnce(tweets_dev_labels, tweets_dev_classified_labels, "RNN_LSTM")
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment