def analyze(input_dir, sentiment_writer, entity_writer, sample, log_file):
 logging.basicConfig(filename=log_file, level=logging.DEBUG)
 service = get_service()
 reader = document_generator(input_dir, sample)
 process_movie_reviews(service, reader, sentiment_writer, entity_writer)

def analyze ( input_dir , sentiment_writer , entity_writer , sample , log_file ) : logging . basicConfig ( filename = log_file , level = logging . DEBUG ) service = get_service ( ) reader = document_generator ( input_dir , sample ) process_movie_reviews ( service , reader , sentiment_writer , entity_writer )
analyze the document for sentiment and entities .