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
8fb46926
Commit
8fb46926
authored
Nov 18, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页feed增加低质量日记排序,增加offline_score_v1灰度实验
parent
6ec4f210
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
gm_feed_cold_start.py
eda/smart_rank/gm_feed_cold_start.py
+26
-8
No files found.
eda/smart_rank/gm_feed_cold_start.py
View file @
8fb46926
...
...
@@ -12,7 +12,7 @@ def get_all_city_id():
return
city_tag_ids
def
search_diary_by_match_phrase
(
tag_names
,
city_tag_id
):
def
search_diary_by_match_phrase
(
tag_names
,
city_tag_id
,
version
):
q
=
dict
()
if
city_tag_id
==
-
1
:
sort_list
=
[]
...
...
@@ -29,12 +29,22 @@ def search_diary_by_match_phrase(tag_names, city_tag_id):
'_cache'
:
True
,
}}
]
sort_list
+=
[
{
'has_video_cover'
:
{
'order'
:
'asc'
}},
{
"good_click"
:
{
"order"
:
"desc"
}},
{
'offline_score'
:
{
'order'
:
'desc'
}},
{
'last_update_time'
:
{
'order'
:
'desc'
}}
]
if
version
:
sort_list
+=
[
{
'is_low_quality'
:
{
'order'
:
'asc'
}},
{
'has_video_cover'
:
{
'order'
:
'asc'
}},
{
"good_click"
:
{
"order"
:
"desc"
}},
{
'offline_score_v1'
:
{
'order'
:
'desc'
}},
{
'last_update_time'
:
{
'order'
:
'desc'
}}
]
else
:
sort_list
+=
[
{
'is_low_quality'
:
{
'order'
:
'asc'
}},
{
'has_video_cover'
:
{
'order'
:
'asc'
}},
{
"good_click"
:
{
"order"
:
"desc"
}},
{
'offline_score'
:
{
'order'
:
'desc'
}},
{
'last_update_time'
:
{
'order'
:
'desc'
}}
]
total_query_should_list
=
[]
for
tag_name
in
tag_names
:
term_dict
=
{
...
...
@@ -148,6 +158,7 @@ if __name__ == "__main__":
light_clinic_beauty_topic_queue_key
=
"coldstart:light:clinic:beauty:topic:queue"
light_clinic_beauty_qa_queue_key
=
"coldstart:light:clinic:beauty:qa:queue"
light_clinic_beauty_diary_queue_key
=
"coldstart:light:clinic:beauty:diary:queue"
light_clinic_beauty_diary_queue_key2
=
"coldstart:light:clinic:beauty:diary:queue:offline:score:v1"
card_types
=
[
'topic'
,
'qa'
]
# 日记有400多个城市,且是hmset,因此不用重置
# word_refers = ['coldstart:hot:search:word', 'coldstart:light:clinic:beauty']
word_refers
=
[
'coldstart:light:clinic:beauty'
]
...
...
@@ -195,7 +206,14 @@ if __name__ == "__main__":
print
(
"轻医美词更新的问答队列长度:
%
s"
%
str
(
len
(
light_clinic_beauty_qa_queue
)))
for
city_tag_id
in
all_city_tag_id
:
diary_queue
=
search_diary_by_match_phrase
(
light_clinic_beauty
,
city_tag_id
)
diary_queue
=
search_diary_by_match_phrase
(
light_clinic_beauty
,
city_tag_id
,
version
=
0
)
light_clinic_beauty_diary_queue
.
update
({
city_tag_id
:
json
.
dumps
(
diary_queue
)})
redis_client
.
hmset
(
light_clinic_beauty_diary_queue_key
,
light_clinic_beauty_diary_queue
)
print
(
"轻医美词更新的日记队列长度:
%
s"
%
str
(
len
(
diary_queue
)))
light_clinic_beauty_diary_queue
=
dict
()
for
city_tag_id
in
all_city_tag_id
:
diary_queue
=
search_diary_by_match_phrase
(
light_clinic_beauty
,
city_tag_id
,
version
=
1
)
light_clinic_beauty_diary_queue
.
update
({
city_tag_id
:
json
.
dumps
(
diary_queue
)})
redis_client
.
hmset
(
light_clinic_beauty_diary_queue_key2
,
light_clinic_beauty_diary_queue
)
print
(
"轻医美词更新的日记队列长度:
%
s"
%
str
(
len
(
diary_queue
)))
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