|
@@ -89,13 +89,13 @@ def get_featurs(mid, data, size, top_K, flow_pool_P, env_dict=None):
|
|
|
day_share_score_list.append(float(per_video_staic[2]))
|
|
|
day_return_rate_list.append(float(per_video_staic[3]))
|
|
|
day_ctr_score_list.append(float(per_video_staic[4]))
|
|
|
- day_view_users_list.append(int(per_video_staic[5]))
|
|
|
- day_view_pv_list.append(int(per_video_staic[6]))
|
|
|
- day_play_users_list.append(int(per_video_staic[7]))
|
|
|
- day_play_pv_list.append(int(per_video_staic[8]))
|
|
|
- day_share_users.append(int(per_video_staic[9]))
|
|
|
- day_share_pv_list.append(int(per_video_staic[10]))
|
|
|
- day_return_users_list.append(int(per_video_staic[11]))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
else:
|
|
|
insert_static_default_fea(day_ctr_score_list, day_play_pv_list, day_play_users_list,
|
|
|
day_return_rate_list, day_return_users_list, day_rov_list,
|
|
@@ -113,7 +113,11 @@ def get_featurs(mid, data, size, top_K, flow_pool_P, env_dict=None):
|
|
|
day_share_pv_list, day_share_return_score_list, day_share_score_list,
|
|
|
day_share_users, day_view_pv_list, day_view_users_list)
|
|
|
hour_rov_list = []
|
|
|
+ hour_share_return_score_list =[]
|
|
|
hour_share_score_list =[]
|
|
|
+ hour_return_rate_list = []
|
|
|
+ hour_ctr_score_list = []
|
|
|
+
|
|
|
if video_hour_static_info:
|
|
|
for i in range(len(video_hour_static_info)):
|
|
|
try:
|
|
@@ -122,17 +126,29 @@ def get_featurs(mid, data, size, top_K, flow_pool_P, env_dict=None):
|
|
|
if video_hour_static_info[i] :
|
|
|
per_hour_video_staic = json.loads(video_hour_static_info[i])
|
|
|
hour_rov_list.append(float(per_hour_video_staic[0]))
|
|
|
+ hour_share_return_score_list.append(float(per_hour_video_staic[1]))
|
|
|
hour_share_score_list.append(float(per_hour_video_staic[2]))
|
|
|
+ hour_return_rate_list.append(float(per_hour_video_staic[3]))
|
|
|
+ hour_ctr_score_list.append(float(per_hour_video_staic[4]))
|
|
|
else:
|
|
|
hour_rov_list.append(0.0)
|
|
|
+ hour_share_return_score_list.append(0.0)
|
|
|
hour_share_score_list.append(0.0)
|
|
|
+ hour_return_rate_list.append(0.0)
|
|
|
+ hour_ctr_score_list.append(0.0)
|
|
|
except Exception:
|
|
|
hour_rov_list.append(0.0)
|
|
|
+ hour_share_return_score_list.append(0.0)
|
|
|
hour_share_score_list.append(0.0)
|
|
|
+ hour_return_rate_list.append(0.0)
|
|
|
+ hour_ctr_score_list.append(0.0)
|
|
|
else:
|
|
|
for i in range(len(recall_list)):
|
|
|
hour_rov_list.append(0.0)
|
|
|
+ hour_share_return_score_list.append(0.0)
|
|
|
hour_share_score_list.append(0.0)
|
|
|
+ hour_return_rate_list.append(0.0)
|
|
|
+ hour_ctr_score_list.append(0.0)
|
|
|
feature_dict["mid_list"] = mid_list
|
|
|
feature_dict["videoid_list"] = videoid_list
|
|
|
feature_dict["apptype_list"] = apptype_list
|
|
@@ -149,16 +165,18 @@ def get_featurs(mid, data, size, top_K, flow_pool_P, env_dict=None):
|
|
|
feature_dict["day_share_score_list"] = day_share_score_list
|
|
|
feature_dict["day_return_rate_list"] = day_return_rate_list
|
|
|
feature_dict["day_ctr_score_list"] = day_ctr_score_list
|
|
|
- feature_dict["day_ctr_score_list"] = day_ctr_score_list
|
|
|
- feature_dict["day_play_pv_list"] = day_play_pv_list
|
|
|
- feature_dict["day_play_users_list"] = day_play_users_list
|
|
|
- feature_dict["day_return_users_list"] = day_return_users_list
|
|
|
- feature_dict["day_share_pv_list"] = day_share_pv_list
|
|
|
- feature_dict["day_view_pv_list"] = day_view_pv_list
|
|
|
- feature_dict["day_view_users_list"] = day_view_users_list
|
|
|
- feature_dict["day_share_users_list"] = day_share_users
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
feature_dict["hour_rov_list"] = hour_rov_list
|
|
|
+ feature_dict["hour_share_return_score_list"] = hour_share_return_score_list
|
|
|
feature_dict["hour_share_score_list"] = hour_share_score_list
|
|
|
+ feature_dict["hour_return_rate_list"] = hour_return_rate_list
|
|
|
+ feature_dict["hour_ctr_score_list "] = hour_ctr_score_list
|
|
|
return feature_dict, recall_list
|
|
|
|
|
|
|
|
@@ -170,13 +188,13 @@ def insert_static_default_fea(day_ctr_score_list, day_play_pv_list, day_play_use
|
|
|
day_share_score_list.append(0.0)
|
|
|
day_return_rate_list.append(0.0)
|
|
|
day_ctr_score_list.append(0.0)
|
|
|
- day_view_users_list.append(0)
|
|
|
- day_view_pv_list.append(0)
|
|
|
- day_play_users_list.append(0)
|
|
|
- day_play_pv_list.append(0)
|
|
|
- day_share_users.append(0)
|
|
|
- day_share_pv_list.append(0)
|
|
|
- day_return_users_list.append(0)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
def get_tf_serving_sores(feature_dict):
|
|
@@ -204,8 +222,11 @@ def get_tf_serving_sores(feature_dict):
|
|
|
"day_share_users": feature_dict["day_share_users_list"],
|
|
|
"day_view_pv": feature_dict["day_view_pv_list"],
|
|
|
"day_view_users":feature_dict["day_view_users_list"],
|
|
|
- "hour_rov_list": feature_dict["hour_rov_list"],
|
|
|
- "hour_share_score_list": feature_dict["hour_share_score_list"]
|
|
|
+ "hour_rov": feature_dict["hour_rov_list"],
|
|
|
+ "hour_share_score": feature_dict["hour_share_score_list"],
|
|
|
+ "hour_share_return_score": feature_dict["hour_share_return_score_list"],
|
|
|
+ "hour_return_rate": feature_dict["hour_return_rate_list"],
|
|
|
+ "hour_ctr_score": feature_dict["hour_ctr_score_list"]
|
|
|
}
|
|
|
request_data_dict= {}
|
|
|
request_data_dict["inputs"] = inputs_data
|