舆情预测函数定义
This commit is contained in:
@@ -39,7 +39,7 @@ def topicdefine():
|
||||
for x in articleList:
|
||||
label_article.append((x[0],predict_topic(x[5])))
|
||||
for x in commentList:
|
||||
label_comments.append((x[5],predict_topic(x[4])))
|
||||
label_comments.append((x[8],predict_topic(x[4])))
|
||||
return label_article,label_comments
|
||||
|
||||
# 更新数据库
|
||||
@@ -53,7 +53,7 @@ def update_data():
|
||||
params = [str(label),str(id)]
|
||||
query(sql, params)
|
||||
for row in label_comments:
|
||||
label, id = row
|
||||
id, label = row
|
||||
sql = "UPDATE comments SET label = %s WHERE authorName = %s"
|
||||
params = [str(label),str(id)]
|
||||
query(sql, params)
|
||||
Reference in New Issue
Block a user