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
7cd08a93
Commit
7cd08a93
authored
Aug 19, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try get cpc data
parent
e970d1af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
main_portrait.py
src/main_portrait.py
+5
-2
portrait.py
src/utils/portrait.py
+9
-1
No files found.
src/main_portrait.py
View file @
7cd08a93
...
@@ -10,7 +10,7 @@ from models.esmm.fe import device_fe, diary_fe, tractate_fe
...
@@ -10,7 +10,7 @@ from models.esmm.fe import device_fe, diary_fe, tractate_fe
from
models.esmm.tractate_model
import
model_predict_tractate
from
models.esmm.tractate_model
import
model_predict_tractate
from
utils.cache
import
get_essm_model_save_path
,
redis_client2
from
utils.cache
import
get_essm_model_save_path
,
redis_client2
from
utils.grey
import
recommed_service_category_device_id_by_tail
from
utils.grey
import
recommed_service_category_device_id_by_tail
from
utils.portrait
import
(
get_user_portrait_tag3_read_v2
,
user_portrait_tag3_get_candidate_dict
,
from
utils.portrait
import
(
get_
cpc_diary_list
,
get_
user_portrait_tag3_read_v2
,
user_portrait_tag3_get_candidate_dict
,
user_portrait_tag3_get_candidate_unread_list
,
user_portrait_tag3_get_ctcvr_queue
,
user_portrait_tag3_get_candidate_unread_list
,
user_portrait_tag3_get_ctcvr_queue
,
user_portrait_tag3_write_ctcvr_data
)
user_portrait_tag3_write_ctcvr_data
)
...
@@ -140,7 +140,10 @@ def main():
...
@@ -140,7 +140,10 @@ def main():
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
time_begin
=
time
.
time
()
time_begin
=
time
.
time
()
main
()
# main()
lst
=
get_cpc_diary_list
()
print
(
lst
)
total_time
=
(
time
.
time
()
-
time_begin
)
/
60
total_time
=
(
time
.
time
()
-
time_begin
)
/
60
print
(
"total cost {:.2f} mins at {}"
.
format
(
total_time
,
datetime
.
datetime
.
now
()))
print
(
"total cost {:.2f} mins at {}"
.
format
(
total_time
,
datetime
.
datetime
.
now
()))
src/utils/portrait.py
View file @
7cd08a93
...
@@ -3,7 +3,7 @@ import json
...
@@ -3,7 +3,7 @@ import json
import
random
import
random
from
itertools
import
chain
,
zip_longest
from
itertools
import
chain
,
zip_longest
from
.cache
import
redis_client2
,
redis_client4
from
.cache
import
redis_client2
,
redis_client
3
,
redis_client
4
# merge_lists([1, 2], [3, 5, 6, 7], [4])
# merge_lists([1, 2], [3, 5, 6, 7], [4])
...
@@ -195,6 +195,14 @@ def user_portrait_tag3_get_candidate_unread_list(device_id, content_type, size=5
...
@@ -195,6 +195,14 @@ def user_portrait_tag3_get_candidate_unread_list(device_id, content_type, size=5
return
queue
return
queue
def
get_cpc_diary_list
():
key
=
"strategy:cpc_diary_list"
data
=
redis_client3
.
get
(
key
)
if
data
:
return
json
.
loads
(
data
)
return
[]
def
user_portrait_tag3_write_ctcvr_data
(
device_id
,
content_type
,
data
):
def
user_portrait_tag3_write_ctcvr_data
(
device_id
,
content_type
,
data
):
"""
"""
device_id:
device_id:
...
...
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