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 samples for natural language api. #425

Merged
merged 10 commits into from
Jul 20, 2016
Merged

Add samples for natural language api. #425

merged 10 commits into from
Jul 20, 2016

Conversation

jerjou
Copy link
Contributor

@jerjou jerjou commented Jul 19, 2016

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 19, 2016
@jerjou jerjou force-pushed the nl branch 3 times, most recently from 71822d8 to 4f07e8c Compare July 20, 2016 00:01
@@ -15,6 +15,7 @@
import os

import pytest
import requests


class Namespace:
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated to PR but shouldn't Namespace inherit from object?

@jerjou
Copy link
Contributor Author

jerjou commented Jul 20, 2016

Updated.

[Set Up a Service Account](https://cloud.google.com/natural-language/docs/common/auth#set_up_a_service_account),
and export the following environment variable:

```
Copy link
Contributor

Choose a reason for hiding this comment

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

does gcloud beta auth application-default login not work btw?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. See my comment here, though..

this will print the top 5 actors with negative sentiment:

```
$ python main.py --inp entity.json
Copy link
Contributor

Choose a reason for hiding this comment

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

first of all, better to put \ at end of each line to make easier copy paste.

secondly I get

TypeError: coercing to Unicode: need string or buffer, NoneType found

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 one also requires you to enable Visino API.

@waprin
Copy link
Contributor

waprin commented Jul 20, 2016

Ok we can nitpick code later but I'm fine to merge once TypeError: coercing to Unicode: need string or buffer, NoneType found issue is fixed

@waprin
Copy link
Contributor

waprin commented Jul 20, 2016

And note about enabling Vision API

@jerjou jerjou force-pushed the nl branch 3 times, most recently from 4729fa0 to 04eac7d Compare July 20, 2016 01:26
Change-Id: I089b244f1a0a2210fffab6f5747eed9f6150147a
puneithk and others added 8 commits July 19, 2016 19:06
Change-Id: I8ff59d08f2ae8ce4cb3dd0b57b3548db3d5b8add
Change-Id: I1367429c3ceaefd0b0d36d9d7cad6ca29cbfdd2d
Change-Id: Iecc1327db4aa21eb5ee61ce58bba3d142e600734
Change-Id: I33a6c3259dc5a9b0cc1ad081cd57acc452fc6b1a
Change-Id: Ic2b721f775601d2dfb718be26d425e7c2e91eb8a
Change-Id: I2eac2d41e3f8d96c1d049dbbc7b48c96d5fded0a
Change-Id: I026963be93ca3ef776420807e14abdcfcc5fe95f
Change-Id: Iab58378f40c760e88f2b3cc0806985894ce77e76
@jerjou
Copy link
Contributor Author

jerjou commented Jul 20, 2016

Merging - we'll add the movie_nl sample in a separate PR

@jerjou jerjou merged commit bd7a093 into master Jul 20, 2016
engelke pushed a commit that referenced this pull request Nov 28, 2022
- [ ] Regenerate this pull request now.

feat: Add tags support
feat: Add RelatedAsset and deprecate RelatedAssets for relationship GA

*The previous representation of the relationship feature is deprecated and unimplemented. The RelatedAsset message represents the new stable format.

PiperOrigin-RevId: 449306805

Source-Link: googleapis/googleapis@3d7bd9d

Source-Link: https://github.com/googleapis/googleapis-gen/commit/71a93d05d6076271d04b7592f7fad0d3f0c7a040
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzFhOTNkMDVkNjA3NjI3MWQwNGI3NTkyZjdmYWQwZDNmMGM3YTA0MCJ9
dandhlee pushed a commit that referenced this pull request Nov 29, 2022
- [ ] Regenerate this pull request now.

feat: Add tags support
feat: Add RelatedAsset and deprecate RelatedAssets for relationship GA

*The previous representation of the relationship feature is deprecated and unimplemented. The RelatedAsset message represents the new stable format.

PiperOrigin-RevId: 449306805

Source-Link: googleapis/googleapis@3d7bd9d

Source-Link: googleapis/googleapis-gen@71a93d0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzFhOTNkMDVkNjA3NjI3MWQwNGI3NTkyZjdmYWQwZDNmMGM3YTA0MCJ9
telpirion pushed a commit that referenced this pull request Jan 18, 2023
* docs(samples): Added comments

* changed comment
dandhlee pushed a commit that referenced this pull request Feb 6, 2023
* docs(samples): Added comments

* changed comment
telpirion pushed a commit that referenced this pull request Mar 13, 2023
* docs(samples): Added comments

* changed comment
dizcology pushed a commit that referenced this pull request Sep 11, 2023
…1.2 (#425)

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
leahecole pushed a commit that referenced this pull request Sep 15, 2023
…1.2 (#425)

Co-authored-by: Anthonios Partheniou <partheniou@google.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.

None yet

5 participants