Skip to content

Instantly share code, notes, and snippets.

@AnasAlmasri
Created February 13, 2019 01:28
Show Gist options
  • Save AnasAlmasri/bc13588ec5b6ae334bf28a37d2de1744 to your computer and use it in GitHub Desktop.
Save AnasAlmasri/bc13588ec5b6ae334bf28a37d2de1744 to your computer and use it in GitHub Desktop.
extract features
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