Commit 0c08312d authored by 张彦钊's avatar 张彦钊

change test file

parent 5814566a
...@@ -29,7 +29,7 @@ def get_esmm_users(): ...@@ -29,7 +29,7 @@ def get_esmm_users():
def get_user_profile(device_id,top_k = 5): def get_user_profile(device_id,top_k = 5):
try:
r = redis.Redis(host="172.16.40.135", port=5379, password="", db=2) r = redis.Redis(host="172.16.40.135", port=5379, password="", db=2)
key = "user:portrait_tags:cl_id:" + str(device_id) key = "user:portrait_tags:cl_id:" + str(device_id)
if r.exists(key): if r.exists(key):
...@@ -50,10 +50,7 @@ def get_user_profile(device_id,top_k = 5): ...@@ -50,10 +50,7 @@ def get_user_profile(device_id,top_k = 5):
tags.append(i[0]) tags.append(i[0])
return tags return tags
else:
return []
except:
return []
def get_searchworlds_to_tagid(): def get_searchworlds_to_tagid():
...@@ -201,6 +198,7 @@ if __name__ == "__main__": ...@@ -201,6 +198,7 @@ if __name__ == "__main__":
name_tag = get_searchworlds_to_tagid() name_tag = get_searchworlds_to_tagid()
tag_list = get_user_profile("00B75E84-7EFC-40A4-8380-E1AA439A0B0D") tag_list = get_user_profile("00B75E84-7EFC-40A4-8380-E1AA439A0B0D")
print("用户画像标签:") print("用户画像标签:")
print(tag_list) print(tag_list)
# queues = get_queues("00C6F623-297E-4608-9988-9774F503639C", "nanchang") # queues = get_queues("00C6F623-297E-4608-9988-9774F503639C", "nanchang")
......
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