-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[NL] v1 and v1beta2 updates #470
Conversation
Codecov Report
@@ Coverage Diff @@
## master #470 +/- ##
=======================================
Coverage 97.16% 97.16%
=======================================
Files 13 13
Lines 458 458
=======================================
Hits 445 445
Misses 13 13 Continue to review full report at Codecov.
|
language/README.md
Outdated
node analyze.v1beta2.js entity-sentiment-text "President Obama is speaking at the White House." | ||
node analyze.v1beta2.js entity-sentiment-file my-bucket Detects sentiment of entities in gs://my-bucket/file.txt | ||
file.txt | ||
node analyze.v1beta2.js classify-text "Android is a mobile operating system developed by Google." |
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.
This text is too short - currently the API requires 20 tokens to return non-empty results. This limitation might be improved in the future but let's use a longer piece of text for the sample just in case.
language/analyze.v1.js
Outdated
function analyzeEntitySentimentOfText (text) { | ||
// [START language_entity_sentiment_string] | ||
// Imports the Google Cloud client library | ||
const language = require('@google-cloud/language').v1beta2(); |
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.
This should be changed to v1.
language/analyze.v1.js
Outdated
function analyzeEntitySentimentInFile (bucketName, fileName) { | ||
// [START language_entity_sentiment_file] | ||
// Imports the Google Cloud client library | ||
const language = require('@google-cloud/language').v1beta2(); |
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.
This should be changed to v1.
const Language = require('@google-cloud/language'); | ||
|
||
// Creates a client | ||
const language = Language.v1beta2(); | ||
|
||
// The text to analyze, e.g. "Hello, world!" | ||
// const text = 'Hello, world!'; |
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.
Probably use a longer text here too.
const Language = require('@google-cloud/language'); | ||
|
||
// Creates a client | ||
const language = Language.v1beta2(); |
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.
Just wondering what's the difference between these two ways of creating a client?
const Language = require('@google-cloud/language');
const language = Language({ apiVersion: 'v1beta2' });
vs
const Language = require('@google-cloud/language');
const language = Language.v1beta2();
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.
The first one uses the generated v1 client, but points it add the v1beta2 service endpoint. The second one uses the generated v1beta2 client (which points at the v1beta2
service endpoint by default).
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
* Move entity-level sentiment samples to v1. * Add text classification. * Adds longer text to README.
* Move entity-level sentiment samples to v1. * Add text classification. * Adds longer text to README.
* chore(main): release 3.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 3.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 3.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 3.0.4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [5.10.0](googleapis/nodejs-security-center@v5.9.0...v5.10.0) (2022-04-11) ### Features * Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([#474](googleapis/nodejs-security-center#474)) ([b29893c](googleapis/nodejs-security-center@b29893c)) * Add next_steps field to finding's list of attributes ([#476](googleapis/nodejs-security-center#476)) ([326e8d2](googleapis/nodejs-security-center@326e8d2)) * AuditConfig for IAM v1 ([#470](googleapis/nodejs-security-center#470)) ([2ec070f](googleapis/nodejs-security-center@2ec070f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@google-cloud/language
package