-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Upon executing the following code on GCE & locally I'm getting 'score' not found error locally while it works on GCE.
def analyze_text(text):
language_client = language.Client()
document = language_client.document_from_text(text)
annotations = document.annotate_text(include_sentiment=True)
print(annotations.sentiment.score)
print (annotations.sentiment.magnitude)
Only difference I can find is on GCE, the gcloud version is different than the local
GCE gcloud
gcloud --version
Google Cloud SDK 145.0.0
alpha 2017.02.21
app-engine-python 1.9.50
beta 2017.02.21
bq 2.0.24
bq-nix 2.0.24
core 2017.02.21
core-nix 2017.02.21
gcloud
gcloud-deps 2017.02.21
gcloud-deps-linux-x86_64 2017.02.21
gsutil 4.22
gsutil-nix 4.22
Local gcloud
gcloud --version
Google Cloud SDK 148.0.1
bq 2.0.24
bq-nix 2.0.24
core 2017.03.24
core-nix 2016.11.07
gcloud
gcloud-deps 2017.03.17
gcloud-deps-darwin-x86_64 2017.02.21
gsutil 4.23
gsutil-nix 4.19
Debugging locally, the response from NL API consist of polarity property and not score.