Skip to content

Instantly share code, notes, and snippets.

@HarshSingh16
Created February 8, 2019 19:01
Show Gist options
  • Save HarshSingh16/f65710d86e3210ad327b68cf678e6367 to your computer and use it in GitHub Desktop.
Save HarshSingh16/f65710d86e3210ad327b68cf678e6367 to your computer and use it in GitHub Desktop.
#SETTING A THRESHOLD AND MAPPING EACH WORD TO A UNIQUE INTEGER
threshold=20
word_number=0
dict_word2integer={}
for word,frequency in word2count.items():
if frequency>20:
dict_word2integer[word]=word_number
word_number+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment