0

Every time I pass a paragraph to analyze_sentiment(), the sentence magnitude score is always just the absolute value of the sentiment score.

I also see this in the example response in the docs, here: https://cloud.google.com/natural-language/docs/basics#sentiment_analysis_response_fields

However, the docs state that magnitude returns between 0.0 and +inf.

Am I missing the meaning of 'magnitude', or is there something else going on?

What is returned in my code

Example values in docs

Docs describing magnitude between 0.0 and +inf

1 Answers1

0

In experimenting further, the API works as following:

-sentence magnitude is always abs(score)

-document magnitude is sum of the sentence magnitudes for the sentences in the document

The documentation is a bit confusing, because it implies that magnitude at the sentence level can be 0 => +inf, but this is only true at the document level.