app.py 文件源码

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

项目:hoot 作者: CatalystOfNostalgia 项目源码 文件源码
def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument('text', location='form', required=True)
        args = parser.parse_args()

        emotion = comment_emotions.emotions(args['text'], g)
        sentic_values = emotion.get_all_sentic_values()
        compound_emotions = emotion.get_compound_emotion()

        sentic_values = [e.name for e in sentic_values if e is not None]
        compound_emotions = [(e.name, v.name) for e, v in compound_emotions]

        return {
            'sentic_values': sentic_values,
            'compound_emotions': compound_emotions
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号