You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a bug per se, but an unnecessary inconsistency IMO between the sentiment.score returned by the Node client and the actual response returned by the Natural Language API.
score of the sentiment ranges between -1.0 (negative) and 1.0 (positive)
However, the Node client currently takes the API response and converts the score to a range of -100 to 100, as described here.
IMO this inconsistency between the API and the Node client adds unnecessary friction to the development process and opens up the possibility of misuse if the client documentation isn't read carefully. (Ie. A developer who has read the API documentation writes code using the Node client that marks text with a sentiment.score greater than 0.8 as "Positive", as mentioned here in the API docs)
I'd propose that the Node client not change the expected score range and leave it as -1.0 to 1.0. I'd be happy to make a pull request with the offending line changed, but wanted to bring this up here first since this would be a semi-breaking change. (Good thing it's still in beta!)
The text was updated successfully, but these errors were encountered:
This isn't a bug per se, but an unnecessary inconsistency IMO between the
sentiment.score
returned by the Node client and the actual response returned by the Natural Language API.According to the Sentiment Analysis Response Fields API documentation:
However, the Node client currently takes the API response and converts the
score
to a range of-100
to100
, as described here.IMO this inconsistency between the API and the Node client adds unnecessary friction to the development process and opens up the possibility of misuse if the client documentation isn't read carefully. (Ie. A developer who has read the API documentation writes code using the Node client that marks text with a
sentiment.score
greater than0.8
as "Positive", as mentioned here in the API docs)I'd propose that the Node client not change the expected
score
range and leave it as-1.0
to1.0
. I'd be happy to make a pull request with the offending line changed, but wanted to bring this up here first since this would be a semi-breaking change. (Good thing it's still in beta!)The text was updated successfully, but these errors were encountered: