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
799ab6a8
Commit
799ab6a8
authored
Nov 27, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户冷启动增加新good click灰度实验
parent
86d9f289
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
gm_feed_cold_start.py
eda/smart_rank/gm_feed_cold_start.py
+15
-6
No files found.
eda/smart_rank/gm_feed_cold_start.py
View file @
799ab6a8
...
...
@@ -71,7 +71,7 @@ def search_diary_by_match_phrase(tag_names, city_tag_id, version):
return
diary_ids
def
search_topic_by_match_phrase
(
tag_names
):
def
search_topic_by_match_phrase
(
tag_names
,
version
=
0
):
q
=
dict
()
total_query_should_list
=
list
()
for
tag_name
in
tag_names
:
...
...
@@ -98,11 +98,17 @@ def search_topic_by_match_phrase(tag_names):
q
[
"_source"
]
=
{
"includes"
:
[
"id"
]
}
q
[
"sort"
]
=
[
{
"is_video"
:
{
"order"
:
"asc"
}},
{
"tractate_score"
:
{
"order"
:
"desc"
}},
{
"good_click"
:
{
"order"
:
"desc"
}}
]
if
version
:
q
[
"sort"
]
=
[
{
"is_video"
:
{
"order"
:
"asc"
}},
{
"tractate_score"
:
{
"order"
:
"desc"
}},
{
"good_click"
:
{
"order"
:
"desc"
}}
]
else
:
q
[
"sort"
]
=
[
{
"is_video"
:
{
"order"
:
"asc"
}},
{
"tractate_score"
:
{
"order"
:
"desc"
}}
]
es_res
=
es_query
(
"tractate"
,
q
,
offset
=
0
,
size
=
200
)
topic_list
=
[]
for
topic_info
in
es_res
[
'hits'
][
'hits'
]:
...
...
@@ -162,6 +168,7 @@ if __name__ == "__main__":
# hot_search_word_qa_queue_key = "coldstart:hot:search:word:qa:queue"
# hot_search_word_diary_queue_key = "coldstart:hot:search:word:diary:queue"
light_clinic_beauty_topic_queue_key
=
"coldstart:light:clinic:beauty:topic:queue"
light_clinic_beauty_topic_queue_grey_key
=
"coldstart:light:clinic:beauty:topic:queue:grey"
light_clinic_beauty_qa_queue_key
=
"coldstart:light:clinic:beauty:qa:queue"
light_clinic_beauty_qa_queue_grey_key
=
"coldstart:light:clinic:beauty:qa:queue:grey"
light_clinic_beauty_diary_queue_key
=
"coldstart:light:clinic:beauty:diary:queue"
...
...
@@ -205,7 +212,9 @@ if __name__ == "__main__":
# 队列存储
light_clinic_beauty_topic_queue
=
search_topic_by_match_phrase
(
light_clinic_beauty
)
light_clinic_beauty_topic_grey_queue
=
search_topic_by_match_phrase
(
light_clinic_beauty
,
version
=
1
)
redis_client
.
rpush
(
light_clinic_beauty_topic_queue_key
,
*
light_clinic_beauty_topic_queue
)
redis_client
.
rpush
(
light_clinic_beauty_topic_queue_grey_key
,
*
light_clinic_beauty_topic_grey_queue
)
print
(
"轻医美词更新的帖子队列长度:
%
s"
%
str
(
len
(
light_clinic_beauty_topic_queue
)))
light_clinic_beauty_qa_queue
=
search_qa_by_match_phrase
(
light_clinic_beauty
)
...
...
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