Created
March 18, 2020 09:28
-
-
Save frenzy2106/0a51ea0f776da57b81a1a49363583577 to your computer and use it in GitHub Desktop.
This file contains 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
#finding the average words present per comment | |
print(corpus[0]) | |
print(corpus_tokens[0:2]) | |
num_of_words_in_doc =[] | |
for doc in corpus_tokens: | |
num_of_words_in_doc.append(len(doc)) | |
print("Average number of words: ", np.average(num_of_words_in_doc)) | |
# Padding the sequences | |
corpus_pad = keras.preprocessing.sequence.pad_sequences(corpus_tokens,maxlen=25,padding='post') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment