Skip to content

Instantly share code, notes, and snippets.

@ravikiranj
Created May 8, 2012 21:10
Show Gist options
  • Select an option

  • Save ravikiranj/2639312 to your computer and use it in GitHub Desktop.

Select an option

Save ravikiranj/2639312 to your computer and use it in GitHub Desktop.
Feature extractor code
#Read the tweets one by one and process it
inpTweets = csv.reader(open('data/sampleTweets.csv', 'rb'), delimiter=',', quotechar='|')
tweets = []
for row in inpTweets:
sentiment = row[0]
tweet = row[1]
processedTweet = processTweet(tweet)
featureVector = getFeatureVector(processedTweet, stopWords)
tweets.append((featureVector, sentiment));
#end loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment