Skip to content

Commit c9a9831

Browse files
chore: increase default timeout; update templates (via synth) (#16)
1 parent f8bb820 commit c9a9831

5 files changed

+1
-13
lines changed

language/v1/language_classify_gcs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def sample_classify_text(gcs_content_uri):
4343

4444
# gcs_content_uri = 'gs://cloud-samples-data/language/classify-entertainment.txt'
4545

46-
# [START language_python_migration_document_gcs]
4746
# Available types: PLAIN_TEXT, HTML
4847
type_ = enums.Document.Type.PLAIN_TEXT
4948

@@ -52,7 +51,6 @@ def sample_classify_text(gcs_content_uri):
5251
# https://cloud.google.com/natural-language/docs/languages
5352
language = "en"
5453
document = {"gcs_content_uri": gcs_content_uri, "type": type_, "language": language}
55-
# [END language_python_migration_document_gcs]
5654

5755
response = client.classify_text(document)
5856
# Loop through classified categories returned from the API

language/v1/language_classify_text.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def sample_classify_text(text_content):
4141

4242
# text_content = 'That actor on TV makes movies in Hollywood and also stars in a variety of popular new TV shows.'
4343

44-
# [START language_python_migration_document_text]
4544
# Available types: PLAIN_TEXT, HTML
4645
type_ = enums.Document.Type.PLAIN_TEXT
4746

@@ -50,7 +49,6 @@ def sample_classify_text(text_content):
5049
# https://cloud.google.com/natural-language/docs/languages
5150
language = "en"
5251
document = {"content": text_content, "type": type_, "language": language}
53-
# [END language_python_migration_document_text]
5452

5553
response = client.classify_text(document)
5654
# Loop through classified categories returned from the API

language/v1/language_entities_text.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def sample_analyze_entities(text_content):
4141

4242
# text_content = 'California is a state.'
4343

44-
# [START language_python_migration_entities_text]
4544
# Available types: PLAIN_TEXT, HTML
4645
type_ = enums.Document.Type.PLAIN_TEXT
4746

@@ -77,7 +76,6 @@ def sample_analyze_entities(text_content):
7776
print(
7877
u"Mention type: {}".format(enums.EntityMention.Type(mention.type).name)
7978
)
80-
# [END language_python_migration_entities_text]
8179

8280
# Get the language of the text, which will be the same as
8381
# the language specified in the request or, if not specified,

language/v1/language_sentiment_text.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def sample_analyze_sentiment(text_content):
4141

4242
# text_content = 'I am so happy and joyful.'
4343

44-
# [START language_python_migration_sentiment_text]
4544
# Available types: PLAIN_TEXT, HTML
4645
type_ = enums.Document.Type.PLAIN_TEXT
4746

@@ -62,8 +61,6 @@ def sample_analyze_sentiment(text_content):
6261
response.document_sentiment.magnitude
6362
)
6463
)
65-
# [END language_python_migration_sentiment_text]
66-
6764
# Get sentiment for all sentences in the document
6865
for sentence in response.sentences:
6966
print(u"Sentence text: {}".format(sentence.text.content))

language/v1/language_syntax_text.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def sample_analyze_syntax(text_content):
5050
language = "en"
5151
document = {"content": text_content, "type": type_, "language": language}
5252

53-
# [START language_python_migration_syntax_text]
5453
# Available values: NONE, UTF8, UTF16, UTF32
5554
encoding_type = enums.EncodingType.UTF8
5655

@@ -64,7 +63,7 @@ def sample_analyze_syntax(text_content):
6463
u"Location of this token in overall document: {}".format(text.begin_offset)
6564
)
6665
# Get the part of speech information for this token.
67-
# Parts of speech are as defined in:
66+
# Parts of spech are as defined in:
6867
# http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
6968
part_of_speech = token.part_of_speech
7069
# Get the tag, e.g. NOUN, ADJ for Adjective, et al.
@@ -73,8 +72,6 @@ def sample_analyze_syntax(text_content):
7372
enums.PartOfSpeech.Tag(part_of_speech.tag).name
7473
)
7574
)
76-
# [END language_python_migration_syntax_text]
77-
7875
# Get the voice, e.g. ACTIVE or PASSIVE
7976
print(u"Voice: {}".format(enums.PartOfSpeech.Voice(part_of_speech.voice).name))
8077
# Get the tense, e.g. PAST, FUTURE, PRESENT, et al.

0 commit comments

Comments
 (0)