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

Add Cloud Natural Language API Java sample. #275

Merged
merged 1 commit into from
Jul 20, 2016
Merged

Add Cloud Natural Language API Java sample. #275

merged 1 commit into from
Jul 20, 2016

Conversation

jerjou
Copy link
Contributor

@jerjou jerjou commented Jul 19, 2016

This sample shows how to use the Cloud Natural Language API to do entity
recognition. The client libraries are vendored in while we are in alpha.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 19, 2016
Please follow the [Set Up Your Project](https://cloud.google.com/natural-language/docs/getting-started#set_up_your_project)
steps in the Quickstart doc to create a project and enable the
Cloud Natural Language API. Following those steps, make sure that you
[Set Up a Service Account](https://cloud.google.com/natural-language/docs/common/auth#set_up_a_service_account),
Copy link
Contributor

Choose a reason for hiding this comment

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

This really isn't necessary in most instances. But I won't block on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dunno - I feel like it's the most failsafe way to do things. The other methods of getting credentials have too many caveats attached to them :-/

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a huge fan of gcloud for credentials and DefaultAuth.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here my (possibly outdated) understanding:

gcloud

  • auth login which works sometimes but fails subtly because it uses user auth on the cloudsdktool project instead of a service account that's attached to the project. Also you'll have to swap this out with a service account anyway once you go to production, if you're not on GCE/GAE.
  • auth activate-service-account which requires downloading a service account anyway, and what happens in your production scripts if you're not on GCE/GAE? I suppose you could have your machine run the gcloud command as part of setup? Seems like more overhead than setting an env variable..
  • In general, requires installing gcloud on every machine you run the code on (unless you're on GAE/GCE)

I assume by DefaultAuth you mean the default service account on GAE/GCE? Which is fine, unless you're not on GAE/GCE, in which case we have to mention that and explain what to do in that case, so it doesn't save any explanation space (though yes - if you are running on GAE/GCE, you can just skip that paragraph).

Point being - it's fine, but there's a lot of explaining and decision points around whether you're on GAE/GCE, that folks probably don't care about when they're looking at a sample like this, so it's simpler to just have one not-too-complex explanation that works in all instances :)

Copy link
Contributor

Choose a reason for hiding this comment

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

gcloud beta auth application-default is the latest hotness.

Copy link
Contributor

Choose a reason for hiding this comment

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

Image of Yaktocat

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately doesn't seem to work :(

Copy link
Contributor

Choose a reason for hiding this comment

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

Should let Vijay know.

@lesv
Copy link
Contributor

lesv commented Jul 20, 2016

@tswast Can you enable the language api's for whatever project we run tests with?
LGTM

@jerjou
Copy link
Contributor Author

jerjou commented Jul 20, 2016

Removed unnecessary test dependency.
Also added NL api to the test project.

<!-- For checking HTTP response codes. -->
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't a servlet app, so it's not required here.

@lesv
Copy link
Contributor

lesv commented Jul 20, 2016

LGTM - assuming things pass.

This sample shows how to use the Cloud Natural Language API to do entity
recognition. The client libraries are vendored in while we are in alpha.

Change-Id: I037901017d0ffb7ffc73cc78c43badaff1dffd3c
@jerjou
Copy link
Contributor Author

jerjou commented Jul 20, 2016

Whoops. Removed the wrong dependency -_-

@lesv
Copy link
Contributor

lesv commented Jul 20, 2016

LGTM once tests pass.

@jerjou jerjou merged commit d7f1d7f into master Jul 20, 2016
@jerjou jerjou deleted the nl branch July 20, 2016 00:40
minherz pushed a commit that referenced this pull request Nov 9, 2022
…275)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `12.1.0` -> `13.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-errorreporting).
minherz pushed a commit that referenced this pull request Nov 10, 2022
…275)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `12.1.0` -> `13.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-errorreporting).
minherz pushed a commit that referenced this pull request Nov 10, 2022
…275)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `12.1.0` -> `13.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-errorreporting).
charlieyu1996 pushed a commit that referenced this pull request Nov 10, 2022
* Sample code for Jobs - V4

Sample code for Jobs v4 APIs.

* feat: Add Job Search v4 API

* Updated as per comment

* No more required.

samples/snippets/pom.xml will take care of specific version

* Migrated to parent folder

Maintaing v4 as the defacto version for now. Later it can be moved to version specific package if required.

* test: configure extra cts environment variables

* fixed listjobs test

fixed listjobs test

* fixed lint.

Co-authored-by: Jeff Ching <[email protected]>
Shabirmean pushed a commit that referenced this pull request Nov 11, 2022
…11.2 (#275)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.11.1` -> `2.11.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/compatibility-slim/2.11.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/confidence-slim/2.11.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-bigquery</summary>

### [`v2.11.2`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#&#8203;2112-httpsgithubcomgoogleapisjava-bigquerycomparev2111v2112-2022-05-18)

[Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.11.1...v2.11.2)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-contact-center-insights).
Shabirmean pushed a commit that referenced this pull request Nov 11, 2022
…11.2 (#275)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.11.1` -> `2.11.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/compatibility-slim/2.11.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.11.2/confidence-slim/2.11.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-bigquery</summary>

### [`v2.11.2`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#&#8203;2112-httpsgithubcomgoogleapisjava-bigquerycomparev2111v2112-2022-05-18)

[Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.11.1...v2.11.2)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-contact-center-insights).
Shabirmean pushed a commit that referenced this pull request Nov 16, 2022
* add update intent samples

* Fixed lint

* lint fix

* lint fix

* lint fix

* lint fix

* lint fix

* lint fix

* lint fix

* fixed failing test

* lint fix

* failing test fix

* Fix failing test

* fixed fialing test

* Added Agent Builder

* removed unused builder

* lint fix

* lint fix

* Fixed comments

* Updated main

* Lint fix

* removed return type

* Fix build error

* added exception

* fixed failing test

* added missing include

* Rebased

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Shabirmean pushed a commit that referenced this pull request Nov 17, 2022
* add update intent samples

* Fixed lint

* lint fix

* lint fix

* lint fix

* lint fix

* lint fix

* lint fix

* lint fix

* fixed failing test

* lint fix

* failing test fix

* Fix failing test

* fixed fialing test

* Added Agent Builder

* removed unused builder

* lint fix

* lint fix

* Fixed comments

* Updated main

* Lint fix

* removed return type

* Fix build error

* added exception

* fixed failing test

* added missing include

* Rebased

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants