Sentiment analysis limited to only 10 reviews

User 5228 | 5/25/2016, 3:38:18 AM


I have been using the following methods in the sentiment analysis toolkit:

model = graphlab.productsentiment.create(…) model.sentimentsummary([keywords])

What I have noticed is:

  • The review_count returned is always 10 for all the keywords
  • The mean_sentiment is calculated only using these 10 reviews

So if I specify k=100, it still only uses 10 reviews.

Is this correct? Is there a way to use all the reviews in the calculation?


User 19 | 5/25/2016, 7:42:54 AM

Hi eduthie,

You are correct. I've reproduced the issue. The k argument is (improperly) ignored when searching documents.

This issue will be fixed in an upcoming version of GraphLab Create. If needed, a quick workaround is to edit the Python code directly. In graphlab/toolkits/product_sentiment/ (near line 955 or so) you will need to change

search_results = searcher.query(keyword)

to instead be

search_results = searcher.query(keyword, num_results=k) If you have trouble locating this file, let us know.

Thank you for reporting this, and we're always interested in any other feedback you may have.