File tree 2 files changed +4
-4
lines changed
language/snippets/cloud-client/v1beta2
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 18
18
def run_quickstart ():
19
19
# [START language_quickstart]
20
20
# Imports the Google Cloud client library
21
- # [START beta_import_client]
22
- # [START beta_import]
23
21
from google .cloud import language_v1beta2
24
22
from google .cloud .language_v1beta2 import enums
25
23
from google .cloud .language_v1beta2 import types
26
- # [END beta_import]
27
24
28
25
# Instantiates a client with the v1beta2 version
29
26
client = language_v1beta2 .LanguageServiceClient ()
30
- # [END beta_import_client]
31
27
32
28
# The text to analyze
33
29
text = u'Hallo Welt!'
Original file line number Diff line number Diff line change 24
24
import argparse
25
25
import sys
26
26
27
+ # [START beta_import]
27
28
from google .cloud import language_v1beta2
28
29
from google .cloud .language_v1beta2 import enums
29
30
from google .cloud .language_v1beta2 import types
31
+ # [END beta_import]
30
32
import six
31
33
32
34
@@ -166,7 +168,9 @@ def syntax_file(gcs_uri):
166
168
# [START def_entity_sentiment_text]
167
169
def entity_sentiment_text (text ):
168
170
"""Detects entity sentiment in the provided text."""
171
+ # [START beta_client]
169
172
client = language_v1beta2 .LanguageServiceClient ()
173
+ # [END beta_client]
170
174
171
175
if isinstance (text , six .binary_type ):
172
176
text = text .decode ('utf-8' )
You can’t perform that action at this time.
0 commit comments