Commit e527affb authored by 赵威's avatar 赵威

import time

parent 02b10027
import datetime
import random
import time
import tensorflow as tf
......@@ -36,13 +37,17 @@ def user_portrait_scan_info(device_dict, diary_dict, predict_fn):
def offline_predict(device_id, device_dict, diary_dict, predict_fn):
time_begin = time.time()
diary_ids = user_portrait_tag3_get_candidate_unread_list(device_id, "diary")
print("diary_ids: " + str(len(diary_ids)))
# print(diary_ids[:10])
diary_ids = random.sample(diary_ids, 500)
res = model_predict_diary(device_id, diary_ids, device_dict, diary_dict, predict_fn)
print("res: " + str(len(res)) + "\n")
user_portrait_tag3_write_ctcvr_data(device_id, "diary", res[:500])
total_time = (time.time() - time_begin)
print("total cost {:.5f}s\n".format(total_time))
def main():
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.INFO)
......
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