Explorar o código

generate label for mysql

罗俊辉 hai 1 ano
pai
achega
f4bee97106
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      process_data.py

+ 2 - 2
process_data.py

@@ -34,7 +34,7 @@ class DataProcessor(object):
         :return:none
         """
         # 把 label, video_title, daily_dt_str, 存储到 mysql 数据库中去
-        label_path = "data/train_data/daily-label-20240101-20240325.json"
+        label_path = "data/train_data/daily-label-20240326-20240331.json"
         with open(label_path, encoding="utf-8") as f:
             self.label_data = json.loads(f.read())
 
@@ -214,7 +214,7 @@ class UserProcess(object):
         dt_list = self.client_spider.select(sql)
         for item in tqdm(dt_list):
             video_id, dt = item
-            user_info_obj = data.get(dt, {}).get(video_id)
+            user_info_obj = data.get(dt, {}).get(str(video_id))
             if user_info_obj:
                 try:
                     video_id = user_info_obj['video_id']