2
votes

In this part of the documentation of the Google Cloud Platform Natural Language API, it is described that

The overall score and magnitude values for an entity are an aggregate of the specific score and magnitude values for each mention of the entity.

I can't figure out how this aggregation works. In the example provided in the documentation, Marvin Gaye has two mentions. One of the mentions has a sentiment of 0.4 and a magnitude of 0.4, the other mention has a score of -0.2 and a magnitude 0.2. The aggregate sentiment for Marvin Gaye is score 0.1 and magnitude 0.6.

I have tried other texts myself and can't figure out how the aggregation is made. Does anyone know?

2

2 Answers

0
votes

I think it depends on the length of the document, and how are you using some key words, i ran some tests and the results were all different except for a couple when i used a name of a famous person and didn't use any expression showing a emotion, because always got 0. I can say that it's not an a sum of values, could be some weird operation using the values that is showed in the response. About the Marvin Gaye example, the result is a mixed sentiment, because of the use of the emotions: "is the best" and "so sad".

Hope this helps with your research.

0
votes

I contacted Google Cloud Platform Support and got this answer:

"The way the aggregation works is breaking down the input text into smaller components, often ngrams, which is likely why the documentation talks about aggregation, however, the aggregation isn't a simple addition, one can't sum individual sentiment values of each entity to get a total score."

So it doesn't seem possible to give a simple explanation of exactly how the aggregation is made.