-
Notifications
You must be signed in to change notification settings - Fork 604
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
language: analyzeEntitySentiment support #2193
Conversation
Is this going to replace |
Not sure, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs!
packages/language/src/document.js
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/language/src/index.js
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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 |
@stephenplusplus I think it would be better to get some feedback from googlers on this. |
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. |
Thanks for the information.
Why? |
We do not want to merge this for a couple of reasons.
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. |
This adds support for the
analyzeEntitySentiment
rpc.