Commit 9eb2e43a authored by 赵威's avatar 赵威

set redis data

parent 70208d2e
......@@ -92,12 +92,13 @@ def save_tag_vector_to_redis(all_tags_lst, model):
for name in all_tags_lst:
try:
vec = model.wv.get_vector(name).tolist()
res[name] = json.dumps(vec)
res[name] = vec
except Exception as e:
pass
redis_key = "rims:tractate:tags:vector"
if res:
redis_client5.hmset(redis_key, json.dumps(res))
redis_client5.set(redis_key, json.dumps(res))
# TODO remove
redis_client5.expire(redis_key, 60 * 60 * 24 * 3)
print("tags vector redis: " + str(len(res)))
......
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