feat: 영문 RSS 글감 자동 번역+재작성 지원
- 수집 시 영문 소스 자동 감지 (한국어 비율 5% 미만) - 영문 글감 글쓰기 프롬프트에 번역+한국맥락 재작성 지시 추가 - 한국 시장 비교, 국내 대안 서비스 언급 유도 - 제목도 한국어로 새로 작성하도록 지시 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -386,9 +386,15 @@ def collect_rss_feeds(sources_cfg: dict) -> list[dict]:
|
||||
pub_at = None
|
||||
if hasattr(entry, 'published_parsed') and entry.published_parsed:
|
||||
pub_at = datetime(*entry.published_parsed[:6], tzinfo=timezone.utc).isoformat()
|
||||
title_text = entry.get('title', '')
|
||||
desc_text = entry.get('summary', '') or entry.get('description', '')
|
||||
# 한국어 문자가 거의 없으면 영문 소스로 판단
|
||||
combined = title_text + desc_text
|
||||
kr_chars = sum(1 for c in combined if '\uac00' <= c <= '\ud7a3')
|
||||
is_english = kr_chars / max(len(combined), 1) < 0.05
|
||||
items.append({
|
||||
'topic': entry.get('title', ''),
|
||||
'description': entry.get('summary', '') or entry.get('description', ''),
|
||||
'topic': title_text,
|
||||
'description': desc_text,
|
||||
'source': 'rss',
|
||||
'source_name': feed_cfg.get('name', ''),
|
||||
'source_url': entry.get('link', ''),
|
||||
@@ -397,6 +403,7 @@ def collect_rss_feeds(sources_cfg: dict) -> list[dict]:
|
||||
'topic_type': 'trending',
|
||||
'_trust_override': trust,
|
||||
'_rss_category': feed_cfg.get('category', ''),
|
||||
'is_english': is_english,
|
||||
})
|
||||
except Exception as e:
|
||||
logger.warning(f"RSS 수집 실패 ({url}): {e}")
|
||||
|
||||
Reference in New Issue
Block a user