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
9097fb52
Commit
9097fb52
authored
Oct 18, 2019
by
谢祁峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7fe217ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
collect_data.py
linucb/views/collect_data.py
+11
-7
No files found.
linucb/views/collect_data.py
View file @
9097fb52
...
...
@@ -615,13 +615,17 @@ class CollectData(object):
# 首页搜索精准匹配标签关键字进linucb
elif
'SYS'
in
data
and
'APP'
in
data
and
'action'
in
data
[
'SYS'
]
and
data
[
'SYS'
][
'action'
]
==
"api/v1/cards/topic"
:
tag_name
=
raw_val_dict
[
"APP"
]
.
get
(
"query"
,
[])
tag_name
=
raw_val_dict
[
"APP"
]
.
get
(
"query"
,
""
)
tag_id
=
raw_val_dict
[
"APP"
]
.
get
(
"action"
)
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
tag
=
tag_name
)
.
values_list
(
"id"
))
tag_list
.
append
(
tag_id
)
logging
.
info
(
"action=cards_topic,tagid_list:
%
s"
%
tag_list
)
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
tag_list
,
5
)
5
)
logging
.
info
(
"update lintag success"
)
# (客户端创建回答,后台创建回答或修改回答关联标签关键字进linucb
elif
'SYS'
in
data
and
'APP'
in
data
and
'action'
in
data
[
'SYS'
]
and
\
(
data
[
'SYS'
][
'action'
]
in
(
"venus/community/topic/create"
,
"venus/sun/topic/edit"
)):
...
...
@@ -632,8 +636,8 @@ class CollectData(object):
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
tag_list
,
10
)
tag_list
,
10
)
# 创建问题关注标签关键字进linucb
elif
'SYS'
in
data
and
'APP'
in
data
and
'action'
in
data
[
'SYS'
]
and
\
data
[
'SYS'
][
'action'
]
==
"venus/sun/pictorial/edit"
:
...
...
@@ -644,8 +648,8 @@ class CollectData(object):
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
tag_list
,
20
)
tag_list
,
20
)
else
:
if
msg
:
logging
.
warning
(
"unknown type msg:
%
s"
%
raw_val_dict
.
get
(
"type"
,
"missing type"
))
...
...
@@ -664,7 +668,7 @@ class CollectData(object):
# 新增四种用户兴趣分行为
# 四种日志均为后端埋点日志
def
transfer_update_recommend_tag_list
(
self
,
device_id
,
user_feature
,
user_id
,
tag_list
,
score_loop
=
1
):
if
len
(
tag_list
)
>
0
:
if
len
(
tag_list
)
>
0
:
is_click
=
1
is_vote
=
0
reward
=
1
if
is_click
or
is_vote
else
0
...
...
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