Christina
Christina

Reputation: 255

Google Cloud Natural Language API - How is document magnitude calculated?

I am currently working with the Google Cloud Natural Language API and need to know how the magnitude value for a whole document (consisting of several sentences) is calculated?

For the document sentiment score the average of the scores for each sentence is taken. For the document magnitude I would have assumed that it's calculated by taking the absolute sum of the individual magnitude values for each sentence. But after testing some paragraphs it's clear that it's not the correct way to calculate it. Would anyone be able to explain this to me?

Any help is much appreciated!

Upvotes: 0

Views: 424

Answers (1)

Mona Attariyan
Mona Attariyan

Reputation: 189

It is calculated as as the sum of the magnitudes from all sentences. Would you provide an example in your tests where this isn't correct?

Upvotes: 1

Related Questions