def parse_sentiment_file(self, file):
    file_sentiment = file['documentSentiment']
    file_entities = [x['name'] for x in file['entities']]
    file_entities = ' '.join(file_entities)
    file_sentences_text = [x['text']['content'] for x in file['sentences']]
    file_sentences_text = ' '.join(file_sentences_text)
    file_sentences_sentiment = [x['sentiment'] for x in file['sentences']]
    file_sentences_sentiment_sum = pd.DataFrame.from_dict(file_sentences_sentiment, orient='columns').sum()
    file_sentences_sentiment_sum = file_sentences_sentiment_sum.add_prefix('document_sum_').to_dict()
    file_sentences_sentiment_mean = pd.DataFrame.from_dict(file_sentences_sentiment, orient='columns').mean()
    file_sentences_sentiment_mean = file_sentences_sentiment_mean.add_prefix('document_mean_').to_dict()
    file_sentences_sentiment_var = pd.DataFrame.from_dict(file_sentences_sentiment, orient='columns').sum()
    file_sentences_sentiment_var = file_sentences_sentiment_var.add_prefix('document_var_').to_dict()
    file_sentiment.update(file_sentences_sentiment_mean)
    file_sentiment.update(file_sentences_sentiment_sum)
    file_sentiment.update(file_sentences_sentiment_var)
    file_sentiment.update({'sentiment_text': file_sentences_text})
    file_sentiment.update({'sentiment_entities': file_entities})
    return pd.Series(file_sentiment)
def parse_sentiment_file(self, file):
    file_sentiment = file['documentSentiment']
    file_entities = [x['name'] for x in file['entities']]
    file_entities = ' '.join(file_entities)
    file_sentences_text = [x['text']['content'] for x in file['sentences']]
    file_sentences_text = ' '.join(file_sentences_text)
    file_sentences_sentiment = [x['sentiment'] for x in file['sentences']]
    file_sentences_sentiment_sum = pd.DataFrame.from_dict(file_sentences_sentiment, orient='columns').sum()
    file_sentences_sentiment_sum = file_sentences_sentiment_sum.add_prefix('document_sum_').to_dict()
    file_sentences_sentiment_mean = pd.DataFrame.from_dict(file_sentences_sentiment, orient='columns').mean()
    file_sentences_sentiment_mean = file_sentences_sentiment_mean.add_prefix('document_mean_').to_dict()
    file_sentences_sentiment_var = pd.DataFrame.from_dict(file_sentences_sentiment, orient='columns').sum()
    file_sentences_sentiment_var = file_sentences_sentiment_var.add_prefix('document_var_').to_dict()
    file_sentiment.update(file_sentences_sentiment_mean)
    file_sentiment.update(file_sentences_sentiment_sum)
    file_sentiment.update(file_sentences_sentiment_var)
    file_sentiment.update({'sentiment_text': file_sentences_text})
    file_sentiment.update({'sentiment_entities': file_entities})
    return pd.Series(file_sentiment)