Skip to content

Commit 1529dd0

Browse files
author
James Campbell
committed
updates
1 parent d0227f6 commit 1529dd0

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed
File renamed without changes.

sentiment_analysis_nltk-example.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# USE FOR PYTHON 3 only
77
import nltk
88
import sys
9-
from sys import exit
109
import pickle
1110

1211
pos_tweets = [('I love this car', 'positive'),
@@ -77,7 +76,7 @@ def extract_features(document):
7776

7877
# optional to save your classifier so you can load it
7978
# elsewhere without having to rebuild training set every time
80-
save_classifier = open("tweetposneg.pickle", "wb")
79+
save_classifier = open("assets/tweetposneg.pickle", "wb")
8180
pickle.dump(classifier, save_classifier)
8281
save_classifier.close()
8382

@@ -103,4 +102,3 @@ def extract_features(document):
103102
else:
104103
poscount = poscount + 1
105104
print('Positive count: %s \nNegative count: %s' % (poscount, negcount))
106-
exit()

tweetposneg.pickle

-17.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)