Commit 202e830c authored by 赵威's avatar 赵威

update printer

parent d3d2ff25
......@@ -6,7 +6,8 @@ import tensorflow as tf
from models.esmm.fe import (get_device_dict_from_redis, get_diary_dict_from_redis)
from models.esmm.model import model_predict_diary
from utils.cache import redis_client2
from utils.portrait import (user_portrait_tag3_get_candidate_unread_list, user_portrait_tag3_write_ctcvr_data)
from utils.portrait import (user_portrait_tag3_get_candidate_dict, user_portrait_tag3_get_candidate_unread_list,
user_portrait_tag3_write_ctcvr_data)
def user_portrait_scan_info(device_dict, diary_dict, predict_fn):
......@@ -23,9 +24,10 @@ def user_portrait_scan_info(device_dict, diary_dict, predict_fn):
key = str(key, "utf-8")
device_id = key.split(":")[-1]
offline_predict(device_id, device_dict, diary_dict, predict_fn)
if (user_portrait_tag3_get_candidate_dict(device_id, "diary")):
offline_predict(device_id, device_dict, diary_dict, predict_fn)
all_count += 1
all_count += 1
print("all count: " + str(all_count))
print("scan done " + str(datetime.datetime.now()))
......@@ -38,8 +40,8 @@ def offline_predict(device_id, device_dict, diary_dict, predict_fn):
print("diary_ids")
print(diary_ids[:10])
res = model_predict_diary(device_id, diary_ids, device_dict, diary_dict, predict_fn)
print("res: " + str(len(res)))
# user_portrait_tag3_write_ctcvr_data(device_id, "diary", res)
print("res: " + str(len(res)) + "\n")
# user_portrait_tag3_write_ctcvr_data(device_id, "diary", res[:500])
def main():
......
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