-
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
Movie sample changes (in progress) - DO NOT MERGE before Nov 15. #597
Conversation
@puneith can you add "MERGE ON {DATE}" to the title? |
@jonparrott Good idea :) |
@jerjou @jonparrott Please review. |
@@ -318,12 +280,15 @@ def rank_entities(reader, sentiment=None, topn=None, reverse_bool=False): | |||
|
|||
|
|||
def get_service(): | |||
"""Build a client to the Google Cloud Natural Language API.""" | |||
""""Build a client to the Google Cloud Natural Language API.""" |
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.
extra "
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.
done
return discovery.build('language', 'v1', | ||
credentials=credentials, | ||
http=http, |
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.
You should only need to specify credentials
and not http
, yeah?
@@ -69,18 +69,18 @@ def test_process_movie_reviews(): | |||
entities = [json.loads(entity) for entity in entities] | |||
|
|||
# assert sentiments | |||
assert sentiments[0].get('sentiment') == 1.0 | |||
assert sentiments[0].get('sentiment') == 0.9 |
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.
Can't these values change as the model changes? Should you just assert that sentiments are some non-None value?
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.
Yes but they don't happen that frequently. And so above check allows us to see if something really failed. Non-None will not allow us to detect some issue model or API might have.
@jonparrott discovery public and pending changes made. |
@puneith merging, but please send a follow-up PR to remove httplib2 usage as soon as possible. |
Source-Link: googleapis/synthtool@6ed3a83 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@6ed3a83 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@6ed3a83 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
No description provided.