Commit 84eb38b3 authored by lixiaofang's avatar lixiaofang

修改热搜词

parent ca181dec
...@@ -33,7 +33,6 @@ def search_hotword(device_id=-1): ...@@ -33,7 +33,6 @@ def search_hotword(device_id=-1):
""" """
try: try:
all_tag_name_list = set() all_tag_name_list = set()
logging.info("get redis_client:%s" % redis_client)
results_registr_tag = json.loads(redis_client.get("physical:search_hotword:results_registr_tag")) results_registr_tag = json.loads(redis_client.get("physical:search_hotword:results_registr_tag"))
results_tag = json.loads(redis_client.get("physical:search_hotword:results_tag")) results_tag = json.loads(redis_client.get("physical:search_hotword:results_tag"))
# 先获取搜索推荐热词 # 先获取搜索推荐热词
...@@ -52,7 +51,6 @@ def search_hotword(device_id=-1): ...@@ -52,7 +51,6 @@ def search_hotword(device_id=-1):
if len(all_tag_name_list) == 6 or num == results_tag: if len(all_tag_name_list) == 6 or num == results_tag:
break break
logging.info("get all_tag_name_list:%s" % all_tag_name_list)
# 获取个性化标签 # 获取个性化标签
linucb_recommend_redis_prefix = "physical:linucb:tag_recommend:device_id:" linucb_recommend_redis_prefix = "physical:linucb:tag_recommend:device_id:"
tag_recommend_redis_key = linucb_recommend_redis_prefix + str(device_id) tag_recommend_redis_key = linucb_recommend_redis_prefix + str(device_id)
...@@ -63,8 +61,6 @@ def search_hotword(device_id=-1): ...@@ -63,8 +61,6 @@ def search_hotword(device_id=-1):
set(Tag.objects.filter(id=item, is_online=True).values_list("name", flat=True))) set(Tag.objects.filter(id=item, is_online=True).values_list("name", flat=True)))
all_tag_name_list.add(results_tag_recommend[0]) all_tag_name_list.add(results_tag_recommend[0])
if len(all_tag_name_list) == 12: if len(all_tag_name_list) == 12:
logging.info("get all_tag_name_list:%s" % all_tag_name_list)
return {"recommend_tag_name": list(all_tag_name_list)} return {"recommend_tag_name": list(all_tag_name_list)}
# 取不够数则取核心标签 # 取不够数则取核心标签
...@@ -78,7 +74,6 @@ def search_hotword(device_id=-1): ...@@ -78,7 +74,6 @@ def search_hotword(device_id=-1):
if results_tag_hexin[0] not in all_tag_name_list: if results_tag_hexin[0] not in all_tag_name_list:
all_tag_name_list.add(results_tag_hexin[0]) all_tag_name_list.add(results_tag_hexin[0])
if len(all_tag_name_list) >= 12: if len(all_tag_name_list) >= 12:
logging.info("get all_tag_name_list:%s" % all_tag_name_list)
return {"recommend_tag_name": list(all_tag_name_list)} return {"recommend_tag_name": list(all_tag_name_list)}
except: except:
......
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