舆情函数定义
This commit is contained in:
+3
-10
@@ -1,5 +1,6 @@
|
|||||||
from utils.query import query
|
from utils.query import query
|
||||||
from utils.getPublicData import *
|
from utils.getPublicData import *
|
||||||
|
from model2.model_use import *
|
||||||
articleList = getAllArticleData()
|
articleList = getAllArticleData()
|
||||||
commentList = getAllCommentsData()
|
commentList = getAllCommentsData()
|
||||||
|
|
||||||
@@ -31,22 +32,14 @@ def drop_label1():# 删除标注列
|
|||||||
params = []
|
params = []
|
||||||
query(sql, params)
|
query(sql, params)
|
||||||
|
|
||||||
|
|
||||||
# 处理数据并添加标注
|
# 处理数据并添加标注
|
||||||
def process_data(data):
|
|
||||||
processed_data =testmodel(data)
|
|
||||||
return processed_data
|
|
||||||
|
|
||||||
def testmodel(test):
|
|
||||||
return "wicao"
|
|
||||||
|
|
||||||
def topicdefine():
|
def topicdefine():
|
||||||
label_article=[]
|
label_article=[]
|
||||||
label_comments=[]
|
label_comments=[]
|
||||||
for x in articleList:
|
for x in articleList:
|
||||||
label_article.append((x[0],process_data(x[5])))
|
label_article.append((x[0],predict_topic(x[5])))
|
||||||
for x in commentList:
|
for x in commentList:
|
||||||
label_comments.append((x[5],process_data(x[4])))
|
label_comments.append((x[5],predict_topic(x[4])))
|
||||||
return label_article,label_comments
|
return label_article,label_comments
|
||||||
|
|
||||||
# 更新数据库
|
# 更新数据库
|
||||||
|
|||||||
Reference in New Issue
Block a user