user_analysis.py 文件源码

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

项目:Mastodon-OSINT 作者: scott48074 项目源码 文件源码
def get_toot_sentiment(toot):
        '''
        Utility function to classify sentiment of passed toots
        using textblob's sentiment method
        '''
        # create TextBlob object of passed toot text
        analysis = TextBlob(toot)
        # set sentiment
        if analysis.sentiment.polarity > 0:
            return 'positive'
        elif analysis.sentiment.polarity == 0:
            return 'neutral'
        else:
            return 'negative'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号