Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
5c0ec458
Commit
5c0ec458
authored
Aug 25, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update dairyQueueUpdate file
parent
8158ed1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
diaryQueueUpdate.py
diaryQueueUpdate.py
+9
-12
No files found.
diaryQueueUpdate.py
View file @
5c0ec458
...
@@ -106,15 +106,8 @@ def get_score(queue_arg):
...
@@ -106,15 +106,8 @@ def get_score(queue_arg):
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
result
=
cursor
.
fetchall
()
score_df
=
pd
.
DataFrame
(
list
(
result
))
.
dropna
()
score_df
=
pd
.
DataFrame
(
list
(
result
))
.
dropna
()
if
score_df
.
empty
:
db
.
close
()
print
(
"获取的日记列表是空"
)
return
score_df
return
False
else
:
score_df
=
score_df
.
rename
(
columns
=
{
0
:
"score"
,
1
:
"cid"
})
print
(
"日记打分表"
)
print
(
score_df
.
head
(
1
))
db
.
close
()
return
score_df
def
update_dairy_queue
(
score_df
,
predict_score_df
):
def
update_dairy_queue
(
score_df
,
predict_score_df
):
...
@@ -221,11 +214,15 @@ def pipe_line(queue_name, queue_arg, device_id):
...
@@ -221,11 +214,15 @@ def pipe_line(queue_name, queue_arg, device_id):
predict
(
queue_name
,
queue_arg
,
device_id
)
predict
(
queue_name
,
queue_arg
,
device_id
)
predict_score_df
=
save_result
(
queue_name
,
queue_arg
,
device_id
)
predict_score_df
=
save_result
(
queue_name
,
queue_arg
,
device_id
)
score_df
=
get_score
(
queue_arg
)
score_df
=
get_score
(
queue_arg
)
if
score_df
:
if
score_df
.
empty
:
print
(
"获取的日记列表是空"
)
return
False
else
:
score_df
=
score_df
.
rename
(
columns
=
{
0
:
"score"
,
1
:
"cid"
})
print
(
"日记打分表"
)
print
(
score_df
.
head
(
1
))
diary_queue
=
update_dairy_queue
(
score_df
,
predict_score_df
)
diary_queue
=
update_dairy_queue
(
score_df
,
predict_score_df
)
return
diary_queue
return
diary_queue
else
:
return
False
def
user_update
(
device_id
,
city_id
,
data_set_cid
):
def
user_update
(
device_id
,
city_id
,
data_set_cid
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment