Commit 4551cb1a authored by 张彦钊's avatar 张彦钊

change test file

parent 225b77ba
......@@ -22,18 +22,15 @@ def get_user_profile(device_id = "9C5E7C73-380C-4623-8F48-A64C8034E315"):
r = redis.Redis(host="172.16.40.135", port=5379, password="", db=2)
key = "user:portrait_tags:cl_id:" + str(device_id)
tmp = json.loads(r.get(key).decode('utf-8'))
search_tag = {}
for i in tmp:
if i["content"] in name_tag.keys():
search_tag[name_tag[i["content"]]] = i["score"]
print(search_tag)
print("filter")
print(tmp)
tag_score = {}
for i in tmp:
if i["type"] == "tag":
tag_score[i["content"]] = i["score"]
tag_score.update(search_tag)
elif i["content"] in name_tag.keys():
tag_score[name_tag[i["content"]]] = i["score"]
print(tag_score)
tag_sort = sorted(tag_score.items(), key=lambda x: x[1], reverse=True)
tags = []
if len(tag_sort) > 5:
......@@ -108,6 +105,7 @@ if __name__ == "__main__":
#
# total_samples.todf
# to_data_base(df)
# to kv
......
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