Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language: Sentiment score range is inconsistent with API documentation #1834

Closed
sawyerh opened this issue Nov 28, 2016 · 1 comment
Closed
Assignees
Labels
api: language Issues related to the Cloud Natural Language API API.

Comments

@sawyerh
Copy link
Contributor

sawyerh commented Nov 28, 2016

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:

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!)

@stephenplusplus
Copy link
Contributor

Makes sense, PR would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: language Issues related to the Cloud Natural Language API API.
Projects
None yet
Development

No branches or pull requests

2 participants