Skip to content

Instantly share code, notes, and snippets.

@wandabwa2004
Created January 17, 2020 04:32
Show Gist options
  • Save wandabwa2004/d3194d28a1452bd278f2d22e913aaf6e to your computer and use it in GitHub Desktop.
Save wandabwa2004/d3194d28a1452bd278f2d22e913aaf6e to your computer and use it in GitHub Desktop.
##Bigrams models for each quarter.
bigram_q1 = gensim.models.Phrases(data_words_q1, min_count=3, threshold=100) # higher threshold fewer phrases.
bigram_q2 = gensim.models.Phrases(data_words_q2, min_count=3, threshold=100) # higher threshold fewer phrases.
bigram_q3 = gensim.models.Phrases(data_words_q3, min_count=3, threshold=100) # higher threshold fewer phrases.
bigram_q4 = gensim.models.Phrases(data_words_q4, min_count=3, threshold=100) # higher threshold fewer phrases.
# Faster way to get a sentence clubbed as a bigram
bigram_mod_q1 = gensim.models.phrases.Phraser(bigram_q1)
bigram_mod_q2 = gensim.models.phrases.Phraser(bigram_q2)
bigram_mod_q3 = gensim.models.phrases.Phraser(bigram_q3)
bigram_mod_q4 = gensim.models.phrases.Phraser(bigram_q4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment