ikegami-yukino / oseti

Dictionary based Sentiment Analysis for Japanese
MIT License
91 stars 15 forks source link

Add option to output raw score #1

Closed yskn67 closed 5 years ago

yskn67 commented 5 years ago

I want to calculate sentiment polarity in overall document. Is it not good idea?

ikegami-yukino commented 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?

yskn67 commented 5 years ago

@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?

ikegami-yukino commented 5 years ago

@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.

yskn67 commented 5 years ago

@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!

ikegami-yukino commented 5 years ago

@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
yskn67 commented 5 years ago

@ikegami-yukino It looks good to me.