NRCLexicon.py 文件源码

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

项目:aueb.twitter.sentiment 作者: nlpaueb 项目源码 文件源码
def __init__(self,lexicon):
        #initialize two dictionaries (unigrams and bigrams)
        self.d_unigrams = {}
        self.d_bigrams = {}

        #select which lexicon to load
        if lexicon == 0 :
            self.loadHashtagLexicon1()
        elif lexicon == 1:
            self.loadHashtagLexicon2()
        elif lexicon == 2 :
            self.loadMaxDiffTwitterLexicon()
        elif lexicon == 3 :
            self.loadSentiment140Lexicon1()
        elif lexicon == 4 :
            self.loadSentiment140Lexicon2()
        elif lexicon == 5 :
            self.loadEmotionLexicon()
        else:
            print "Lexicon unavailable, please load another one"

    #HashtagSentimentAffLexNegLex
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号