Google\Cloud\NaturalLanguage\Annotation::sentiment PHP Method

sentiment() public method

Example: $sentiment = $annotation->sentiment(); if ($sentiment['score'] > 0) { echo 'This is a positive message.'; }
See also: https://cloud.google.com/natural-language/reference/rest/v1beta1/Sentiment Sentiment type documentation
public sentiment ( ) : array | null
return array | null
    public function sentiment()
    {
        return isset($this->info['documentSentiment']) ? $this->info['documentSentiment'] : null;
    }