def update_item():
    db = client.lagou.intervieweeComment
    query_dict = {}
    for document in query_document(query_dict):
        sentiment_value = cal_sentiment(document['content'])
        db.update_many(
            {"orderId": document['orderId']},
            {"$set": {"sentiment": sentiment_value}}
        )
        print('insert sentiment value %f successfully~' % sentiment_value)
示例#2
0
def update_item():
    db = client.lagou.intervieweeComment
    query_dict = {}
    for document in query_document(query_dict):
        sentiment_value = cal_sentiment(document['content'])
        db.update_many({"orderId": document['orderId']},
                       {"$set": {
                           "sentiment": sentiment_value
                       }})
        print('insert sentiment value %f successfully~' % sentiment_value)