Created
February 8, 2019 07:46
-
-
Save HarshSingh16/a5c318611e11a28855ef9f6ba5d59d68 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
#Creating a dictionary that maps each word to its occurences | |
#For questions | |
word2count={} | |
for sentence in Clean_questions: | |
for word in sentence.split(): | |
if word not in word2count: | |
word2count[word]=1 | |
else: | |
word2count[word]+=1 | |
#For answers | |
for sentence in Clean_answers: | |
for word in sentence.split(): | |
if word not in word2count: | |
word2count[word]=1 | |
else: | |
word2count[word]+=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment