Closed yskn67 closed 5 years ago
@yskn67 Thanks. But, personally, I feel it is not intuitive.
Instead of switching return value by the option, would you like to add new method?
@ikegami-yukino
You mean adding the method to get raw polarity score instead of analysis
method?
In that case, which name is suitable for this method?
get_sentiment_polarity_score? get_sentiment_polarity_dictionaly_score?
or others?
@yskn67 In the first place, how do you plan to use the raw polarity score? If only the raw score and the number of sentimental/opinion words are output, other users may not know how to use it.
@ikegami-yukino I want to calculate polarity in overall documents, not per sentence. So, I want to check how much there are polar words in the document. Yes, your comment is correct. Almost users have no benefit for this method. For the moment, I'll commit to only my forked repository. Thank you for taking time!
@yskn67 I thought about it again, what do you think about adding the method, which counts polarity expression?
For example:
a = oseti.Analyzer()
counter = Counter()
for sentence in document:
counter += a.count_polarity(sentence)
print(counter)
#=> Counter({'positive': 3, 'negative': 1})
document_polarity_score = (counter['positive'] + -1 * counter['negative']) / sum(counter.values())
print(document_polarity_score)
#=> 0.5
@ikegami-yukino It looks good to me.
I want to calculate sentiment polarity in overall document. Is it not good idea?