-
Notifications
You must be signed in to change notification settings - Fork 598
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 updates #1783
Language updates #1783
Conversation
@stephenplusplus PTAL! |
+1 on not multiplying magnitude. |
Awesome, that being said do you think we should be consistent and not multiply score as well? |
No, they're not the same value range, so we can't achieve consistency between them. All of our APIs multiply -1.0 through 1.0 ranges. |
@@ -196,13 +197,34 @@ Document.PART_OF_SPEECH = { | |||
* text. | |||
* @param {object[]} callback.annotation.tokens - Parts of speech that were | |||
* detected from the text. | |||
* @param {object[]} callback.annotation.tokens.text - The piece of text | |||
* @param {string} callback.annotation.tokens[].text - The piece of text |
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.
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.
* // 'Google is an American multinational technology company' + | ||
* // 'specializing in Internet-related services and products.' | ||
* // beginOffset: -1 | ||
* // text: { |
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.
* @param {boolean} options.verbose - Enable verbose mode for more detailed | ||
* results. Default: `false` | ||
* @param {function} callback - The callback function. | ||
* @param {?error} callback.err - An error occurred while making this request. | ||
* @param {number} callback.sentiment - A value in the range of `-100` to `100`. | ||
* Large numbers represent more positive sentiments. | ||
* @param {number} callback.sentiment.sentiment - A value in the range of `-100` |
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.
* // content: | ||
* // 'Google is an American multinational technology company' + | ||
* // 'specializing in Internet-related services and products.', | ||
* // beingOffset: -1 |
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.
@@ -331,7 +359,18 @@ describe('Language', function() { | |||
assert.deepEqual(annotation.tokens[0], { | |||
text: 'Hello', | |||
partOfSpeech: 'Other: foreign words, typos, abbreviations', | |||
partOfSpeechTag: 'X' | |||
tag: 'X', | |||
aspect: 'ASPECT_UNKNOWN', |
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.
Are we going to change the version to 1.0? Or is this meaning something else? Not sure if we're ready to say 1.0 here.... |
@jgeewax sorry about the confusion, we're moving from the upstream v1beta1 api to the upstream v1 api. We will not be publishing the library itself as 1.0 |
* @param {boolean} options.verbose - Enable verbose mode for more detailed | ||
* results. Default: `false` | ||
* @param {function} callback - The callback function. | ||
* @param {?error} callback.err - An error occurred while making this request. | ||
* @param {number} callback.sentiment - A value in the range of `-100` to `100`. | ||
* Large numbers represent more positive sentiments. | ||
* @param {number} callback.sentiment - A value in the range of `-100` |
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.
@@ -601,8 +660,21 @@ Document.prototype.detectEntities = function(options, callback) { | |||
* } | |||
* | |||
* // sentiment = { | |||
* // polarity: 100, | |||
* // magnitude: 40 | |||
* // sentiment: { |
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.
|
||
var syntax = { | ||
sentences: Document.formatSentences_(resp.sentences, verbose), | ||
tokens: Document.formatTokens_(resp.tokens, verbose), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Changes Unknown when pulling 2005c08 on callmehiphop:language-updates into * on GoogleCloudPlatform:master*. |
* text. | ||
* @param {object[]} callback.syntax.tokens - Parts of speech that were | ||
* detected from the text. | ||
* @param {string} callback.syntax.language - The language detected from the |
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.
* results. Default: `false` | ||
* @param {function} callback - The callback function. | ||
* @param {?error} callback.err - An error occurred while making this request. | ||
* @param {object} callback.syntax - The recognizd syntax from the text. |
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.
* @resource [documents.analyzeSyntax API Documentation]{@link https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeSyntax} | ||
* | ||
* @param {object=} options - Configuration object. See | ||
* [documents.annotateText](https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeSyntax#request-body). |
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.
* // tokens: [ | ||
* // { | ||
* // text: 'Google', | ||
* // partOfSpeech: 'Noun (common and proper)' |
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.
* // }, | ||
* // dependencyEdge: { | ||
* // headTokenIndex: 1, | ||
* // label: 'NSUBJ' |
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.
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.
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
for (var part in token) { | ||
if (token.hasOwnProperty(part) && /UNKNOWN/.test(token[part])) { | ||
token[part] = false; |
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.
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.
Please re-assign when it's ready for another look. |
LGTM. Re-assign when the blockers are cleared. |
Changes Unknown when pulling 62d397d on callmehiphop:language-updates into * on GoogleCloudPlatform:master*. |
googleapis/googleapis#190 has been merged, and the new proto is already in the master of https://github.com/googleapis/googleapis. @stephenplusplus, please update google-proto-files package. |
@callmehiphop @jmdobry googleapis/googleapis#190 has been merged. Can one of you take care of updating google-proto-files? |
Thanks @jmdobry and @stephenplusplus. |
Language v1 proto is available in |
Thanks @jmdobry. @stephenplusplus have your requested changes been satisfied? Also, Travis seems unhappy. Is this just flakiness? |
Dave explained that the unhappiness is just depending on the google-proto-files update. |
Yep, just update google-proto-files to 0.9.0 (@callmehiphop simultaneously published to npm). |
Should be good to go on this. |
@callmehiphop Remember to get your google-proto-files |
@jmdobry I ended up unpublishing it since you beat me to it :) |
Updates Natural Language to 1.0 proto files!
Notable Changes
AnalyzeSyntax
in the form ofdocument#detectSyntax
sentiment.polarity
was renamed tosentiment.score
partOfSpeech
received 11 new attributesPossible Conflicts (per API team review)
100
appears to be problematic. While score (polarity) returns a value between -1 and 1, magnitude is unbounded. That being said I'm not sure we're creating a meaningful number for magnitude by multiplying it.TODO