GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — language: Sentiment score range is inconsistent with API documentation · Issue #1834 · googleapis/google-cloud-node

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

New issue
Copy link
New issue
Copy link
Closed
Closed
language: Sentiment score range is inconsistent with API documentation#1834
Copy link
Assignees
stephenplusplus
Labels
api: languageIssues related to the Cloud Natural Language API API.

Description

@sawyerh
sawyerh
opened on Nov 28, 2016
Issue body actions

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

Activity

  1. stephenplusplus commented on Nov 28, 2016

    @stephenplusplus
    stephenplusplus
    on Nov 28, 2016
    Contributor
    More actions

    Makes sense, PR would be awesome!

  2. stephenplusplus
    added
    enhancement
    api: languageIssues related to the Cloud Natural Language API API.
    on Nov 28, 2016
  3. stephenplusplus
    closed this as completedin #1836on Nov 29, 2016
  4. stephenplusplus
    added a commit that references this issue on Nov 29, 2016

    language: remove sentiment and salience range conversions (#1834) (#1836

    50082da
  5. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  6. sofisl
    added 2 commits that reference this issue on Oct 11, 2022

    language: remove sentiment and salience range conversions (#1834) (#1836

    7867638

    language: remove sentiment and salience range conversions (#1834) (#1836

    733893a
  7. GautamSharda
    added a commit that references this issue on Mar 11, 2026

    chore(deps): update dependency gapic-tools to ^0.2.0 (#1834)

    75692d5
  8. sofisl
    added a commit that references this issue on Mar 17, 2026

    chore(deps): update dependency gapic-tools to ^1.0.3 (#1834)

    dc9d7bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: languageIssues related to the Cloud Natural Language API API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.