Last active
November 6, 2017 20:58
-
-
Save Joshuaek/b08fc9761a5f1e79fa932c4689d4f458 to your computer and use it in GitHub Desktop.
This file contains 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
def toBOW(sentance, words): | |
bag = [] | |
for word in words: | |
bag.append(1) if word in sentance else bag.append(0) | |
return bag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment