def analyze_document(service, document):
 logging.info('Analyzing {}'.format(document.doc_id))
 (sentiments, entities) = document.extract_sentiment_entities(service)
 return (sentiments, entities)

def analyze_document ( service , document ) : logging . info ( 'Analyzing {}' . format ( document . doc_id ) ) ( sentiments , entities ) = document . extract_sentiment_entities ( service ) return ( sentiments , entities )
analyze the document and get the distribution of sentiments and the movie name .