Skip to content

Instantly share code, notes, and snippets.

@HarshSingh16
Created February 8, 2019 18:37
Show Gist options
  • Save HarshSingh16/a3431bf35ccbf483d4a8f3f1005e0247 to your computer and use it in GitHub Desktop.
Save HarshSingh16/a3431bf35ccbf483d4a8f3f1005e0247 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_integer={}
for word,frequency in word2count.items():
if frequency>20:
dict_integer[word]=word_number
word_number+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment