Created
February 8, 2019 08:31
-
-
Save HarshSingh16/8b5c598e4c006c45ce1e5b562a3d0b23 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 a unique integer and also checking if the frequency threshold is met | |
threshold=20 | |
questionswordstoint={} | |
wordnumber=0 | |
for word,count in word2count.items(): | |
if count>=threshold: | |
questionswordstoint[word]=wordnumber | |
wordnumber+=1 | |
answersswordstoint={} | |
wordnumber=0 | |
for word,count in word2count.items(): | |
if count>=threshold: | |
answersswordstoint[word]=wordnumber | |
wordnumber+=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment