Last active
June 2, 2020 01:00
-
-
Save sai-teja-ponugoti/2541c81357487e0a436e3c27ca496791 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# forming new sentences for testing, feel free to experiment | |
# sentence 1 is bit sarcastic, whereas sentence two is a general statment. | |
new_sentence = [ | |
"granny starting to fear spider in the garden might be real", | |
"game of thrones season finale showing this sunday night"] | |
# Converting the sentences to sequences using tokenizer | |
new_sequences = tokenizer.texts_to_sequences(new_sentence) | |
# padding the new sequences to make them have same dimensions | |
new_padded = pad_sequences(new_sequences, maxlen = max_length, | |
padding = padding_type, | |
truncating = trunc_type) | |
new_padded = np.array(new_padded ) | |
print(model.predict(new_padded)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment