Browse Source

generate label for mysql

罗俊辉 1 year ago
parent
commit
113f3c9361
1 changed files with 2 additions and 2 deletions
  1. 2 2
      process_data.py

+ 2 - 2
process_data.py

@@ -124,7 +124,7 @@ class DataProcessor(object):
             # print("title", sql)
             try:
                 title = client.select(sql)[0][0]
-                return title
+                return title.strip()
             except Exception as e:
                 print(video_id, "\t", e)
                 return ""
@@ -163,7 +163,7 @@ class DataProcessor(object):
         select_sql = "SELECT video_id, hour_dt_str FROM lightgbm_data where label = 0 and hour_dt_str < '20240327';"
         init_data_tuple = self.client_spider.select(select_sql)
         init_list = list(init_data_tuple)
-        for item in tqdm(init_list[:100]):
+        for item in tqdm(init_list):
             # print(item)
             process_info(item)
             time.sleep(0.5)