Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
juanboy
2024-07-04 12:17:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
35b908e045c0a7b3bbbfacd2a8b135bf34fa699b
35b908e0
1 parent
d8f1f47b
舆情函数定义
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
model/topicdefine.py
model/topicdefine.py
View file @
35b908e
from
utils.query
import
query
from
utils.getPublicData
import
*
from
model2.model_use
import
*
articleList
=
getAllArticleData
()
commentList
=
getAllCommentsData
()
...
...
@@ -31,22 +32,14 @@ def drop_label1():# 删除标注列
params
=
[]
query
(
sql
,
params
)
# 处理数据并添加标注
def
process_data
(
data
):
processed_data
=
testmodel
(
data
)
return
processed_data
def
testmodel
(
test
):
return
"wicao"
def
topicdefine
():
label_article
=
[]
label_comments
=
[]
for
x
in
articleList
:
label_article
.
append
((
x
[
0
],
pr
ocess_data
(
x
[
5
])))
label_article
.
append
((
x
[
0
],
pr
edict_topic
(
x
[
5
])))
for
x
in
commentList
:
label_comments
.
append
((
x
[
5
],
pr
ocess_data
(
x
[
4
])))
label_comments
.
append
((
x
[
5
],
pr
edict_topic
(
x
[
4
])))
return
label_article
,
label_comments
# 更新数据库
...
...
Please
register
or
login
to post a comment