Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coercing issue when the code is run #4

Open
KungFuPandey opened this issue Jul 27, 2016 · 0 comments
Open

Coercing issue when the code is run #4

KungFuPandey opened this issue Jul 27, 2016 · 0 comments

Comments

@KungFuPandey
Copy link

KungFuPandey commented Jul 27, 2016

I am getting the following error , can you please help ?


TypeError Traceback (most recent call last)
in ()
60 #tries using all words as the feature selection mechanism
61 print 'using all words as features'
---> 62 evaluate_features(make_full_dict)
63
64 #scores words based on chi-squared test to show information gain (http://streamhacker.com/2010/06/16/text-classification-sentiment-analysis-eliminate-low-information-features/)

in evaluate_features(feature_select)
14 #http://stackoverflow.com/questions/367155/splitting-a-string-into-words-and-punctuation
15 #breaks up the sentences into lists of individual words (as selected by the input mechanism) and appends 'pos' or 'neg' after each list
---> 16 with open(RT_POLARITY_POS_FILE, 'r') as posSentences:
17 for i in posSentences:
18 posWords = re.findall(r"[\w']+|[.,!?;]", i.rstrip())

TypeError: coercing to Unicode: need string or buffer, RDD found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant