Skip to content

Commit 067fd1a

Browse files
authored
docs: add spacing for readability (#22)
1 parent c9a9831 commit 067fd1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

language/v1/language_entities_text.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ def sample_analyze_entities(text_content):
5454
encoding_type = enums.EncodingType.UTF8
5555

5656
response = client.analyze_entities(document, encoding_type=encoding_type)
57+
5758
# Loop through entitites returned from the API
5859
for entity in response.entities:
5960
print(u"Representative name for the entity: {}".format(entity.name))
61+
6062
# Get entity type, e.g. PERSON, LOCATION, ADDRESS, NUMBER, et al
6163
print(u"Entity type: {}".format(enums.Entity.Type(entity.type).name))
64+
6265
# Get the salience score associated with the entity in the [0, 1.0] range
6366
print(u"Salience score: {}".format(entity.salience))
67+
6468
# Loop over the metadata associated with entity. For many known entities,
6569
# the metadata is a Wikipedia URL (wikipedia_url) and Knowledge Graph MID (mid).
6670
# Some entity types may have additional metadata, e.g. ADDRESS entities
@@ -72,6 +76,7 @@ def sample_analyze_entities(text_content):
7276
# The API currently supports proper noun mentions.
7377
for mention in entity.mentions:
7478
print(u"Mention text: {}".format(mention.text.content))
79+
7580
# Get the mention type, e.g. PROPER for proper noun
7681
print(
7782
u"Mention type: {}".format(enums.EntityMention.Type(mention.type).name)

0 commit comments

Comments
 (0)