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
f0b5c243
Commit
f0b5c243
authored
Aug 14, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update prediction num
parent
cbda9373
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
main_portrait.py
src/main_portrait.py
+6
-6
No files found.
src/main_portrait.py
View file @
f0b5c243
...
...
@@ -42,10 +42,10 @@ def user_portrait_scan_info(device_dict, diary_dict, tractate_dict, diary_predic
print
(
e
)
def
offline_predict_diary
(
device_id
,
device_dict
,
diary_dict
,
predict_fn
):
def
offline_predict_diary
(
device_id
,
device_dict
,
diary_dict
,
predict_fn
,
size
=
300
):
time_begin
=
time
.
time
()
diary_ids
=
user_portrait_tag3_get_candidate_unread_list
(
device_id
,
"diary"
,
size
=
300
)
diary_ids
=
user_portrait_tag3_get_candidate_unread_list
(
device_id
,
"diary"
,
size
=
size
)
print
(
"diary_ids: "
+
str
(
len
(
diary_ids
)))
res
=
model_predict_diary
(
device_id
,
diary_ids
,
device_dict
,
diary_dict
,
predict_fn
)
print
(
"res: "
+
str
(
len
(
res
)))
...
...
@@ -56,10 +56,10 @@ def offline_predict_diary(device_id, device_dict, diary_dict, predict_fn):
print
(
"total cost {:.5f}s"
.
format
(
total_time
))
def
offline_predict_tractate
(
device_id
,
device_dict
,
tractate_dict
,
predict_fn
):
def
offline_predict_tractate
(
device_id
,
device_dict
,
tractate_dict
,
predict_fn
,
size
=
300
):
time_begin
=
time
.
time
()
tractate_ids
=
user_portrait_tag3_get_candidate_unread_list
(
device_id
,
"tractate"
,
size
=
300
)
tractate_ids
=
user_portrait_tag3_get_candidate_unread_list
(
device_id
,
"tractate"
,
size
=
size
)
print
(
"tractate_ids: "
+
str
(
len
(
tractate_ids
)))
res
=
model_predict_tractate
(
device_id
,
tractate_ids
,
device_dict
,
tractate_dict
,
predict_fn
)
print
(
"res: "
+
str
(
len
(
res
)))
...
...
@@ -91,8 +91,8 @@ def main():
tractate_predict_fn
=
tf
.
contrib
.
predictor
.
from_saved_model
(
tractate_save_path
)
device_id
=
"androidid_a25a1129c0b38f7b"
offline_predict_diary
(
device_id
,
device_dict
,
diary_dict
,
diary_predict_fn
)
offline_predict_tractate
(
device_id
,
device_dict
,
tractate_dict
,
tractate_predict_fn
)
offline_predict_diary
(
device_id
,
device_dict
,
diary_dict
,
diary_predict_fn
,
size
=
100
)
offline_predict_tractate
(
device_id
,
device_dict
,
tractate_dict
,
tractate_predict_fn
,
size
=
100
)
# res = user_portrait_tag3_get_candidate_unread_list(device_id, "diary")
# print(len(res))
...
...
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