Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm_strategy_cvr
Commits
202e830c
Commit
202e830c
authored
Jul 24, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update printer
parent
d3d2ff25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
main_portrait.py
src/main_portrait.py
+7
-5
No files found.
src/main_portrait.py
View file @
202e830c
...
...
@@ -6,7 +6,8 @@ import tensorflow as tf
from
models.esmm.fe
import
(
get_device_dict_from_redis
,
get_diary_dict_from_redis
)
from
models.esmm.model
import
model_predict_diary
from
utils.cache
import
redis_client2
from
utils.portrait
import
(
user_portrait_tag3_get_candidate_unread_list
,
user_portrait_tag3_write_ctcvr_data
)
from
utils.portrait
import
(
user_portrait_tag3_get_candidate_dict
,
user_portrait_tag3_get_candidate_unread_list
,
user_portrait_tag3_write_ctcvr_data
)
def
user_portrait_scan_info
(
device_dict
,
diary_dict
,
predict_fn
):
...
...
@@ -23,9 +24,10 @@ def user_portrait_scan_info(device_dict, diary_dict, predict_fn):
key
=
str
(
key
,
"utf-8"
)
device_id
=
key
.
split
(
":"
)[
-
1
]
offline_predict
(
device_id
,
device_dict
,
diary_dict
,
predict_fn
)
if
(
user_portrait_tag3_get_candidate_dict
(
device_id
,
"diary"
)):
offline_predict
(
device_id
,
device_dict
,
diary_dict
,
predict_fn
)
all_count
+=
1
all_count
+=
1
print
(
"all count: "
+
str
(
all_count
))
print
(
"scan done "
+
str
(
datetime
.
datetime
.
now
()))
...
...
@@ -38,8 +40,8 @@ def offline_predict(device_id, device_dict, diary_dict, predict_fn):
print
(
"diary_ids"
)
print
(
diary_ids
[:
10
])
res
=
model_predict_diary
(
device_id
,
diary_ids
,
device_dict
,
diary_dict
,
predict_fn
)
print
(
"res: "
+
str
(
len
(
res
)))
# user_portrait_tag3_write_ctcvr_data(device_id, "diary", res)
print
(
"res: "
+
str
(
len
(
res
))
+
"
\n
"
)
# user_portrait_tag3_write_ctcvr_data(device_id, "diary", res
[:500]
)
def
main
():
...
...
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