Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
alpha
physical
Commits
d58fe1a1
Commit
d58fe1a1
authored
Oct 18, 2019
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update comment
parent
9113d251
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
topic.py
search/utils/topic.py
+1
-1
topic.py
search/views/topic.py
+4
-4
No files found.
search/utils/topic.py
View file @
d58fe1a1
...
@@ -127,7 +127,7 @@ class TopicUtils(object):
...
@@ -127,7 +127,7 @@ class TopicUtils(object):
user_similar_score_list
=
[],
index_type
=
"topic"
,
routing
=
None
,
attention_tag_list
=
[],
user_similar_score_list
=
[],
index_type
=
"topic"
,
routing
=
None
,
attention_tag_list
=
[],
linucb_user_id_list
=
[],
disable_collpase
=
False
,
has_score
=
False
):
linucb_user_id_list
=
[],
disable_collpase
=
False
,
has_score
=
False
):
"""
"""
:remark:获取首页推荐
帖子
列表
:remark:获取首页推荐
回答
列表
:param user_id:
:param user_id:
:param offset:
:param offset:
:param size:
:param size:
...
...
search/views/topic.py
View file @
d58fe1a1
...
@@ -123,7 +123,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
...
@@ -123,7 +123,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
size
=
size
-
len
(
useful_topic_id_list
)
size
=
size
-
len
(
useful_topic_id_list
)
have_read_topic_id_list
.
extend
(
useful_topic_id_list
)
have_read_topic_id_list
.
extend
(
useful_topic_id_list
)
# linucb 推荐
帖子
# linucb 推荐
回答
linucb_recommend_tags
=
list
()
linucb_recommend_tags
=
list
()
if
STRATEGY_TYPE
.
CTR_GRAY
in
gray_list
:
if
STRATEGY_TYPE
.
CTR_GRAY
in
gray_list
:
topic_recommend_redis_key
=
"ctr_physical:linucb:topic_recommend:device_id:"
+
str
(
device_id
)
topic_recommend_redis_key
=
"ctr_physical:linucb:topic_recommend:device_id:"
+
str
(
device_id
)
...
@@ -138,7 +138,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
...
@@ -138,7 +138,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
if
linucb_recommend_tags
:
if
linucb_recommend_tags
:
linucb_recommend_tags
=
json
.
loads
(
linucb_recommend_tags
)
linucb_recommend_tags
=
json
.
loads
(
linucb_recommend_tags
)
# linucb 推荐新
帖子
# linucb 推荐新
回答
if
linucb_recommend_tags
:
if
linucb_recommend_tags
:
linucb_recommend_tags_set_tags
=
get_same_tagset_ids
(
linucb_recommend_tags
)
linucb_recommend_tags_set_tags
=
get_same_tagset_ids
(
linucb_recommend_tags
)
if
underexposure_lin_topic_count
:
if
underexposure_lin_topic_count
:
...
@@ -147,7 +147,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
...
@@ -147,7 +147,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
have_read_topic_id_list
.
extend
(
underexposure_lin_topic_ids
)
have_read_topic_id_list
.
extend
(
underexposure_lin_topic_ids
)
redis_client
.
publish
(
"new_topic_impression"
,
json
.
dumps
(
underexposure_lin_topic_ids
))
redis_client
.
publish
(
"new_topic_impression"
,
json
.
dumps
(
underexposure_lin_topic_ids
))
# linucb 推荐老
帖子
# linucb 推荐老
回答
recommend_topic_dict
=
redis_client
.
hgetall
(
topic_recommend_redis_key
)
recommend_topic_dict
=
redis_client
.
hgetall
(
topic_recommend_redis_key
)
linucb_recommend_topic_id_list
=
list
()
linucb_recommend_topic_id_list
=
list
()
recommend_topic_list
=
list
()
recommend_topic_list
=
list
()
...
@@ -596,7 +596,7 @@ def home_query(device_id="", tag_id=-1, user_id=-1, query="", offset=0, size=10,
...
@@ -596,7 +596,7 @@ def home_query(device_id="", tag_id=-1, user_id=-1, query="", offset=0, size=10,
def
topic_detail_page_recommend
(
device_id
=
""
,
user_id
=-
1
,
topic_id
=-
1
,
topic_pictorial_id
=-
1
,
topic_user_id
=-
1
,
def
topic_detail_page_recommend
(
device_id
=
""
,
user_id
=-
1
,
topic_id
=-
1
,
topic_pictorial_id
=-
1
,
topic_user_id
=-
1
,
filter_topic_user_id
=
False
,
offset
=
0
,
size
=
10
,
topic_tag_list
=
[]):
filter_topic_user_id
=
False
,
offset
=
0
,
size
=
10
,
topic_tag_list
=
[]):
"""
"""
:remark:
帖子
详情页推荐策略,缺少第一个卡片策略
:remark:
回答
详情页推荐策略,缺少第一个卡片策略
:param user_id:
:param user_id:
:param topic_id:
:param topic_id:
:param topic_group_id:
:param topic_group_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