utilities.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:aueb.twitter.sentiment 作者: nlpaueb 项目源码 文件源码
def savePosScores(pos_tags_scores_neutral, pos_tags_scores_positive,pos_tags_scores_negative,pos_bigrams_scores_neutral,pos_bigrams_scores_positive,pos_bigrams_scores_negative,pos_trigrams_scores_neutral,pos_trigrams_scores_positive,pos_trigrams_scores_negative,mpqaScores):
    with open('resources/scores.pkl', 'wb') as output:
        pickle.dump(pos_tags_scores_neutral, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_tags_scores_positive, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_tags_scores_negative, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_bigrams_scores_neutral, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_bigrams_scores_positive, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_bigrams_scores_negative, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_trigrams_scores_neutral, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_trigrams_scores_positive, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(pos_trigrams_scores_negative, output, pickle.HIGHEST_PROTOCOL)
        pickle.dump(mpqaScores, output, pickle.HIGHEST_PROTOCOL)

    print "POS scores saved"

#save lexicons
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号