-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Conversation
71822d8
to
4f07e8c
Compare
@@ -15,6 +15,7 @@ | |||
import os | |||
|
|||
import pytest | |||
import requests | |||
|
|||
|
|||
class Namespace: |
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.
unrelated to PR but shouldn't Namespace inherit from object?
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: | ||
|
||
``` |
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.
does gcloud beta auth application-default login not work btw?
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.
Not sure. See my comment here, though..
this will print the top 5 actors with negative sentiment: | ||
|
||
``` | ||
$ python main.py --inp entity.json |
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.
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), |
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 one also requires you to enable Visino API.
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 |
And note about enabling Vision API |
4729fa0
to
04eac7d
Compare
Change-Id: I089b244f1a0a2210fffab6f5747eed9f6150147a
Change-Id: I8ff59d08f2ae8ce4cb3dd0b57b3548db3d5b8add
Change-Id: I1367429c3ceaefd0b0d36d9d7cad6ca29cbfdd2d
Change-Id: Iecc1327db4aa21eb5ee61ce58bba3d142e600734
Change-Id: I33a6c3259dc5a9b0cc1ad081cd57acc452fc6b1a
Change-Id: Ic2b721f775601d2dfb718be26d425e7c2e91eb8a
Change-Id: I2eac2d41e3f8d96c1d049dbbc7b48c96d5fded0a
Change-Id: I026963be93ca3ef776420807e14abdcfcc5fe95f
Change-Id: Iab58378f40c760e88f2b3cc0806985894ce77e76
Merging - we'll add the movie_nl sample in a separate PR |
- [ ] 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
- [ ] 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
* docs(samples): Added comments * changed comment
* docs(samples): Added comments * changed comment
* docs(samples): Added comments * changed comment
…1.2 (#425) Co-authored-by: Anthonios Partheniou <partheniou@google.com>
…1.2 (#425) Co-authored-by: Anthonios Partheniou <partheniou@google.com>
No description provided.