def entities_file(gcs_uri):
 language_client = language.Client()
 document = language_client.document_from_url(gcs_uri)
 entities = document.analyze_entities()
 for entity in entities:
  print ('=' * 20)
  print '{:<16}: {}'.format('name', entity.name)
  print '{:<16}: {}'.format('type', entity.entity_type)
  print '{:<16}: {}'.format('wikipedia_url', entity.wikipedia_url)
  print '{:<16}: {}'.format('metadata', entity.metadata)
  print '{:<16}: {}'.format('salience', entity.salience)

def entities_file ( gcs_uri ) : language_client = language . Client ( ) document = language_client . document_from_url ( gcs_uri ) entities = document . analyze_entities ( ) for entity in entities : print ( '=' * 20 ) print '{:<16}: {}' . format ( 'name' , entity . name ) print '{:<16}: {}' . format ( 'type' , entity . entity_type ) print '{:<16}: {}' . format ( 'wikipedia_url' , entity . wikipedia_url ) print '{:<16}: {}' . format ( 'metadata' , entity . metadata ) print '{:<16}: {}' . format ( 'salience' , entity . salience )
detects entities in the file located in google cloud storage .