Created
May 8, 2012 21:10
-
-
Save ravikiranj/2639312 to your computer and use it in GitHub Desktop.
Feature extractor code
This file contains hidden or 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
| #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