@@ -47,17 +47,17 @@ def sample_analyze_entities(gcs_content_uri):
4747 # For list of supported languages:
4848 # https://cloud.google.com/natural-language/docs/languages
4949 language = "en"
50- document = {"gcs_content_uri" : gcs_content_uri , "type " : type_ , "language" : language }
50+ document = {"gcs_content_uri" : gcs_content_uri , "type_ " : type_ , "language" : language }
5151
5252 # Available values: NONE, UTF8, UTF16, UTF32
53- encoding_type = language_v1 .. EncodingType .UTF8
53+ encoding_type = language_v1 .EncodingType .UTF8
5454
5555 response = client .analyze_entities (request = {'document' : document , 'encoding_type' : encoding_type })
5656 # Loop through entitites returned from the API
5757 for entity in response .entities :
5858 print (u"Representative name for the entity: {}" .format (entity .name ))
5959 # Get entity type, e.g. PERSON, LOCATION, ADDRESS, NUMBER, et al
60- print (u"Entity type: {}" .format (language_v1 .Entity .Type (entity .type ).name ))
60+ print (u"Entity type: {}" .format (language_v1 .Entity .Type (entity .type_ ).name ))
6161 # Get the salience score associated with the entity in the [0, 1.0] range
6262 print (u"Salience score: {}" .format (entity .salience ))
6363 # Loop over the metadata associated with entity. For many known entities,
@@ -73,7 +73,7 @@ def sample_analyze_entities(gcs_content_uri):
7373 print (u"Mention text: {}" .format (mention .text .content ))
7474 # Get the mention type, e.g. PROPER for proper noun
7575 print (
76- u"Mention type: {}" .format (language_v1 .EntityMention .Type (mention .type ).name )
76+ u"Mention type: {}" .format (language_v1 .EntityMention .Type (mention .type_ ).name )
7777 )
7878
7979 # Get the language of the text, which will be the same as
0 commit comments