Explorar el Código

新增热点事件

luojunhui hace 1 semana
padre
commit
06a0718187
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      applications/tasks/crawler_tasks/crawler_hot_point.py

+ 5 - 2
applications/tasks/crawler_tasks/crawler_hot_point.py

@@ -35,10 +35,11 @@ class CrawlerHotPointBase(CrawlerHotPointConst):
     CLASSIFY_PROMPT = """
     你是一个内容分析助手,专门从热榜标题中识别出55岁以上老年人可能喜欢或关注的银发内容。
     银发内容通常涉及健康、养老、退休生活、老年疾病、社会保障、代际关系、奇闻趣事、名人故事、社会事件等主题。
-    不要出现政治,当代国家领导人等敏感事件
+    不要出现政治,当代国家领导人等敏感事件,各个地方的垂直新闻信息
     1. **任务描述**:
         扫描所有标题,筛选出与银发内容高度相关时效性新闻信息。相关性判断基于标题是否直接或间接提及老年人相关话题,或可能吸引55岁以上人群的兴趣。返回适合的 id。
-        如果遇到敏感人物,正常过滤。请注意,一定要是新闻性事件, 请严格判断标题是否适合老年群体。
+        如果遇到敏感人物,正常过滤。请注意,一定要是爆炸性新闻事件, 事件会迅速引发社会各界关注。
+        请严格判断标题是否适合老年群体。
     4. **输出格式**:输出结果为 JSON,只需要返回适合老年人话题的 id, 结构为
         {
             "IDS": [1, 2, 3, ...]
@@ -172,6 +173,8 @@ class CrawlerHotPointTask(CrawlerHotPointMapper):
         """
         infos = await self.fetch_init_articles()
         # acquire lock
+        if not infos:
+            return
         title_ids = [item["id"] for item in infos]
         await self.set_as_processing(title_ids)
         prompt = f"{self.CLASSIFY_PROMPT}\n{self.format_input_articles(infos)}"