Created
February 13, 2019 01:28
-
-
Save AnasAlmasri/bc13588ec5b6ae334bf28a37d2de1744 to your computer and use it in GitHub Desktop.
extract features
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 extract_features(tweet): | |
tweet_words = set(tweet) | |
features = {} | |
for word in word_features: | |
features['contains(%s)' % word] = (word in tweet_words) | |
return features |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment