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 16:04:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a61760213b240a49d6d9b5f4118fe4e63cfc0d3d
a6176021
1 parent
406939ea
爬虫结束自动打标注
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
model/topicDefine.py
model/topicDefine.py
View file @
a617602
...
...
@@ -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
[
8
],
predict_topic
(
x
[
4
])))
label_comments
.
append
((
x
[
5
],
x
[
8
],
predict_topic
(
x
[
4
])))
return
label_article
,
label_comments
# 更新数据库
...
...
@@ -53,14 +53,14 @@ def update_data():
params
=
[
str
(
label
),
str
(
id
)]
query
(
sql
,
params
)
for
row
in
label_comments
:
id
,
label
=
row
sql
=
"UPDATE comments SET label =
%
s WHERE authorName =
%
s"
params
=
[
str
(
label
),
str
(
id
)]
id
,
image
,
label
=
row
sql
=
"UPDATE comments SET label =
%
s WHERE authorName=
%
s AND authorAvatar =
%
s"
params
=
[
str
(
label
),
str
(
id
),
str
(
image
)]
query
(
sql
,
params
)
if
__name__
==
'__main__'
:
# drop_label()
# drop_label1()
update_data
()
#删除文章和评论的标签列
# drop_label()
# drop_label1()
\ No newline at end of file
...
...
Please
register
or
login
to post a comment