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
52807b5e
Commit
52807b5e
authored
Nov 24, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gossip tags
parent
e353a4ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+10
-5
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
52807b5e
...
...
@@ -246,19 +246,21 @@ def update_tag3_user_portrait(cl_id):
if
not
order_df
.
empty
:
paid_order_df
=
order_df
[
order_df
[
"event_cn"
]
==
"支付订单"
]
if
not
paid_order_df
.
empty
:
paid_order_df
[
"business_tags"
]
=
list
(
zip
(
paid_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
x
.
split
(
","
)),
paid_order_df
[
"tag_score"
]))
paid_order_df
[
"business_tags"
]
=
list
(
zip
(
paid_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
x
.
split
(
","
)),
paid_order_df
[
"tag_score"
]))
paid_order_df
[
"business_tags_dict"
]
=
paid_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
make_dict_from_pair
(
x
))
paid_business_tags_list
=
paid_order_df
[
"business_tags_dict"
]
.
tolist
()
paid_business_tags_score
=
merge_values
(
paid_business_tags_list
)
validate_order_df
=
order_df
[
order_df
[
"event_cn"
]
==
"验证订单"
]
if
not
validate_order_df
.
empty
:
validate_order_df
[
"business_tags"
]
=
list
(
zip
(
validate_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
x
.
split
(
","
)),
validate_order_df
[
"tag_score"
]))
validate_order_df
[
"business_tags_dict"
]
=
validate_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
make_dict_from_pair
(
x
))
validate_order_df
[
"business_tags"
]
=
list
(
zip
(
validate_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
x
.
split
(
","
)),
validate_order_df
[
"tag_score"
]))
validate_order_df
[
"business_tags_dict"
]
=
validate_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
make_dict_from_pair
(
x
))
validate_business_tags_list
=
validate_order_df
[
"business_tags_dict"
]
.
tolist
()
validate_business_tags_score
=
merge_values
(
validate_business_tags_list
)
tmp_res
=
{}
if
(
len
(
first_demands_score
)
==
0
)
and
(
len
(
first_solutions_score
)
==
0
)
and
(
len
(
first_positions_score
)
==
0
)
and
(
len
(
second_demands_score
)
==
0
)
and
(
len
(
second_solutions_score
)
==
0
)
and
(
len
(
second_positions_score
)
==
0
):
...
...
@@ -282,8 +284,11 @@ def update_tag3_user_portrait(cl_id):
key
=
"doris:user_portrait:tag3:device_id:"
+
str
(
cl_id
)
redis_client
=
get_redis_client
()
anecdote_tags_scores
=
get_user_portrait_tag3_with_score
(
cl_id
)
.
get
(
"anecdote_tags"
,
{})
user_portrait_raw
=
get_user_portrait_tag3_with_score
(
cl_id
)
anecdote_tags_scores
=
user_portrait_raw
.
get
(
"anecdote_tags"
,
{})
gossip_tags_scores
=
user_portrait_raw
.
get
(
"gossip_tags"
,
{})
res
[
"anecdote_tags"
]
=
anecdote_tags_scores
res
[
"gossip_tags"
]
=
gossip_tags_scores
if
(
len
(
first_demands_score
.
keys
())
>
0
)
or
(
len
(
second_demands_score
.
keys
())
>
0
)
or
\
(
len
(
first_solutions_score
.
keys
())
>
0
)
or
(
len
(
second_solutions_score
.
keys
())
>
0
)
or
\
...
...
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