Commit 52807b5e authored by 赵威's avatar 赵威

add gossip tags

parent e353a4ff
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment