Browse Source

冷启动相似度任务增加对视频内容池操作

luojunhui 1 month ago
parent
commit
07b96299ab
1 changed files with 27 additions and 2 deletions
  1. 27 2
      title_similarity_score_task.py

+ 27 - 2
title_similarity_score_task.py

@@ -1,11 +1,36 @@
 """
 @author: luojunhui
 """
+import traceback
+from applications import bot
 from coldStartTasks.filter.title_similarity_task import ColdStartTitleSimilarityTask
 
 
 if __name__ == '__main__':
-    batch_size = 1000
+    batch_size = 3000
     task = ColdStartTitleSimilarityTask()
     task.init_database()
-    task.run(meta_source="article")
+    # process video
+    try:
+        task.run(meta_source="video")
+    except Exception as e:
+        bot(
+            title="视频冷启池nlp任务异常",
+            mention=False,
+            detail={
+                "traceback": traceback.format_exc(),
+                "error": f"{e}"
+            }
+        )
+    # process article
+    try:
+        task.run(meta_source="article")
+    except Exception as e:
+        bot(
+            title="文章冷启池nlp任务异常",
+            mention=False,
+            detail={
+                "traceback": traceback.format_exc(),
+                "error": f"{e}"
+            }
+        )