Skip to content

Commit

Permalink
chore: increase default timeout; update templates (via synth) (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Apr 21, 2020
1 parent f8bb820 commit c9a9831
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions language/v1/language_classify_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def sample_classify_text(gcs_content_uri):

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

# [START language_python_migration_document_gcs]
# Available types: PLAIN_TEXT, HTML
type_ = enums.Document.Type.PLAIN_TEXT

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

response = client.classify_text(document)
# Loop through classified categories returned from the API
Expand Down
2 changes: 0 additions & 2 deletions language/v1/language_classify_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def sample_classify_text(text_content):

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

# [START language_python_migration_document_text]
# Available types: PLAIN_TEXT, HTML
type_ = enums.Document.Type.PLAIN_TEXT

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

response = client.classify_text(document)
# Loop through classified categories returned from the API
Expand Down
2 changes: 0 additions & 2 deletions language/v1/language_entities_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def sample_analyze_entities(text_content):

# text_content = 'California is a state.'

# [START language_python_migration_entities_text]
# Available types: PLAIN_TEXT, HTML
type_ = enums.Document.Type.PLAIN_TEXT

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

# Get the language of the text, which will be the same as
# the language specified in the request or, if not specified,
Expand Down
3 changes: 0 additions & 3 deletions language/v1/language_sentiment_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def sample_analyze_sentiment(text_content):

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

# [START language_python_migration_sentiment_text]
# Available types: PLAIN_TEXT, HTML
type_ = enums.Document.Type.PLAIN_TEXT

Expand All @@ -62,8 +61,6 @@ def sample_analyze_sentiment(text_content):
response.document_sentiment.magnitude
)
)
# [END language_python_migration_sentiment_text]

# Get sentiment for all sentences in the document
for sentence in response.sentences:
print(u"Sentence text: {}".format(sentence.text.content))
Expand Down
5 changes: 1 addition & 4 deletions language/v1/language_syntax_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def sample_analyze_syntax(text_content):
language = "en"
document = {"content": text_content, "type": type_, "language": language}

# [START language_python_migration_syntax_text]
# Available values: NONE, UTF8, UTF16, UTF32
encoding_type = enums.EncodingType.UTF8

Expand All @@ -64,7 +63,7 @@ def sample_analyze_syntax(text_content):
u"Location of this token in overall document: {}".format(text.begin_offset)
)
# Get the part of speech information for this token.
# Parts of speech are as defined in:
# Parts of spech are as defined in:
# http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
part_of_speech = token.part_of_speech
# Get the tag, e.g. NOUN, ADJ for Adjective, et al.
Expand All @@ -73,8 +72,6 @@ def sample_analyze_syntax(text_content):
enums.PartOfSpeech.Tag(part_of_speech.tag).name
)
)
# [END language_python_migration_syntax_text]

# Get the voice, e.g. ACTIVE or PASSIVE
print(u"Voice: {}".format(enums.PartOfSpeech.Voice(part_of_speech.voice).name))
# Get the tense, e.g. PAST, FUTURE, PRESENT, et al.
Expand Down

0 comments on commit c9a9831

Please sign in to comment.