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

Unsafe sentence tokenizer in sentiment analysis #8

Closed
renoust opened this issue Jun 13, 2016 · 0 comments
Closed

Unsafe sentence tokenizer in sentiment analysis #8

renoust opened this issue Jun 13, 2016 · 0 comments

Comments

@renoust
Copy link

renoust commented Jun 13, 2016

Hi!

In jSentiments.py, in polarScores_text(), you are processing each sentence by:

for sent in text.split(u'。'):
   etc.

This part actually crashes when you have an empty sentence coming in, that we can protect using:

for sent in text.split(u'。'):
    if len(sent.strip()) == 0:
         continue
    etc.
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