Commit d9f4efe2 authored by 赵威's avatar 赵威

save vector to redis

parent 77d6b6ad
......@@ -98,6 +98,7 @@ def save_tag_vector_to_redis(all_tags_lst, model):
if res:
redis_client5.hmset(redis_key, json.dumps(res))
redis_client5.expire(redis_key, 60 * 60 * 24 * 3)
print("tags vector redis: " + str(len(res)))
if __name__ == "__main__":
......@@ -119,9 +120,9 @@ if __name__ == "__main__":
for word in all_keywords_set:
jieba.add_word(word, freq=1000, tag="user_defined")
# save_tractate_vector_to_redis(all_keywords_set, model)
save_tractate_vector_to_redis(all_keywords_set, model)
all_tags_lst = [i.encode("utf-8") for i in get_all_business_tags()]
print("all tags: " + str(len(all_tags_lst)))
print(all_tags_lst[:5])
# save_tag_vector_to_redis(all_tags_lst, model)
save_tag_vector_to_redis(all_tags_lst, model)
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