xiaoguo_news_processor: 正文去200字限制,全文发
This commit is contained in:
@@ -97,7 +97,7 @@ def call_xiaoguo(articles):
|
|||||||
for a in articles:
|
for a in articles:
|
||||||
title = re.sub(r'\b\d{6}\b', '', a['title']).strip()
|
title = re.sub(r'\b\d{6}\b', '', a['title']).strip()
|
||||||
title = re.sub(r'\s+', ' ', title)
|
title = re.sub(r'\s+', ' ', title)
|
||||||
content = (a.get('content') or '')[:200]
|
content = a.get('content') or ''
|
||||||
# 给正文加标点分隔(akshare正文无标点,模型推理会卡)
|
# 给正文加标点分隔(akshare正文无标点,模型推理会卡)
|
||||||
if content and not any(c in content for c in '。,!?;'):
|
if content and not any(c in content for c in '。,!?;'):
|
||||||
content = '。'.join([content[i:i+20] for i in range(0, len(content), 20)])
|
content = '。'.join([content[i:i+20] for i in range(0, len(content), 20)])
|
||||||
|
|||||||
Reference in New Issue
Block a user