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: analyzeEntitySentiment support #2193

Closed
wants to merge 3 commits into from
Closed

language: analyzeEntitySentiment support #2193

wants to merge 3 commits into from

Conversation

callmehiphop
Copy link
Contributor

This adds support for the analyzeEntitySentiment rpc.

@callmehiphop callmehiphop added the api: language Issues related to the Cloud Natural Language API API. label Apr 7, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 7, 2017
@stephenplusplus
Copy link
Contributor

Is this going to replace detectSentiment?

@callmehiphop
Copy link
Contributor Author

Is this going to replace detectSentiment?

Not sure, but analyzeSentiment and analyzeEntities are still both available in the v1beta2 proto files, so I would assume not.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 85270d7 on callmehiphop:dg--nl-entity-sentiment into 20cc892 on GoogleCloudPlatform:master.

Copy link
Contributor

@stephenplusplus stephenplusplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs!

@@ -531,6 +529,86 @@ Document.prototype.detectEntities = function(options, callback) {
};

/**
* Detect the entities from a block of text, similar to
* {module:language/document#detectEntities}, and analyzes sentiment associated

This comment was marked as spam.

This comment was marked as spam.

@@ -234,6 +235,92 @@ Language.prototype.detectEntities = function(content, options, callback) {
};

/**
* Detect the entities from a block of text, similar to
* {module:language#detectEntities}, and analyzes sentiment associated with

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor

  • detectEntitySentiment = detect entities; include their sentiment scores
  • detectEntities = detect entities; don't include their sentiment scores

Would things be simpler if we could just use an option to distinguish between intent, as opposed to multiple methods?

language.detectEntities({ sentiment: false }) // default
language.detectEntities({ sentiment: true }) // calls detectEntitySentiment

Better yet, how about we just always include sentiment? Is there something expensive about this method that it needs to be separated from the one that doesn't include sentiment? The API response is exactly the same, with the exception of the sentiment object being present or not.

@callmehiphop
Copy link
Contributor Author

Better yet, how about we just always include sentiment? Is there something expensive about this method that it needs to be separated from the one that doesn't include sentiment? The API response is exactly the same, with the exception of the sentiment object being present or not.

@stephenplusplus I think it would be better to get some feedback from googlers on this.

/cc @monattar @landrito @lukesneeringer

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ef93ee7 on callmehiphop:dg--nl-entity-sentiment into 20cc892 on GoogleCloudPlatform:master.

@monattar
Copy link

Wrt question about why not always including sentiment: This feature is more expensive than all other features. We shouldn't include the sentiment by default, as it will incur high costs that the user might not intend.

We thought quite a bit about where to expose this API (within analyzeEntity, as a separate method, etc), and separate method has been the best. Please do not change the surface.

@stephenplusplus
Copy link
Contributor

Thanks for the information.

and separate method has been the best.

Why?

@lukesneeringer
Copy link
Contributor

lukesneeringer commented Apr 11, 2017

We do not want to merge this for a couple of reasons.

  • We do not want to opt people in to the 1.1 beta API. Users should get v1 unless they explicitly request otherwise.
  • We have decided to only expose the new method on the GAPIC for now (and DPEs are handling documenting this).

Sorry, @callmehiphop -- I did not realize you were working on this last week, or I would have updated you sooner.

This PR is superceded by #2203, which is done the way we (Google internal) settled on yesterday.

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. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants