Merge branch 'fix/news-sources-accuracy'

This commit is contained in:
kyu
2026-06-06 15:35:52 +09:00
2 changed files with 29 additions and 0 deletions
+18
View File
@@ -125,11 +125,29 @@ def extract_morphemes(text):
except:
return [w for w in text.split() if len(w) >= 2 and w not in STOPWORDS]
# 일상어와 철자가 겹쳐 오탐이 잦은 짧은 종목명 — 본문에 주식 맥락 토큰이 같이 있을 때만 인정.
# (예: "지원 대상으로 선정"→대상㈜ 오탐, "동양적 가치관"→동양 오탐 차단)
# 보령·대덕·풍산·세방처럼 일상어로 거의 안 쓰이는 고유 종목명은 넣지 않음(오히려 누락 유발).
AMBIGUOUS_NAMES = {
"대상", "동양", "동서", "미래", "대한", "고려", "한일", "서울", "부산",
"동국", "유성", "남성", "영원", "태양", "대성", "백산", "신성", "한창", "우성",
}
_STOCK_CTX = (
"주가", "주식", "증시", "상장", "상폐", "공시", "영업이익", "매출", "순이익",
"실적", "수주", "계약", "배당", "자사주", "유상증자", "무상증자", "목표주가",
"코스피", "코스닥", "급등", "급락", "상한가", "하한가", "", "그룹", "지주",
"전자", "화학", "제약", "바이오", "반도체", "자동차", "건설", "증권", "철강",
)
def extract_stocks(text):
has_ctx = any(m in text for m in _STOCK_CTX)
found = {}
for name, code in state.stock_map.items():
if len(name) < 2:
continue # 1글자 종목명은 오탐 과다 → 제외
# 모호 종목명은 주식 맥락 토큰이 본문에 있을 때만 인정 (일상어 오탐 차단)
if name in AMBIGUOUS_NAMES and not has_ctx:
continue
if name.isascii():
# 영문/숫자 약칭(KT·SK·DB 등)은 단어경계 강제 (SKT·KTX 오탐 차단)
pat = rf"(?<![A-Za-z0-9]){re.escape(name)}(?![A-Za-z0-9])"
+11
View File
@@ -261,6 +261,17 @@ RSS_SOURCES = [
("더벨", "https://www.thebell.co.kr/free/content/xmlService.asp"),
("세계일보", "https://www.segye.com/RSS/economyRss.xml"),
("SBS Biz", "https://news.sbs.co.kr/news/SectionRssFeed.do?sectionId=EC"),
# ── 증권/마켓·산업 버티컬 확장 (2026-06 검증된 라이브 피드) ──
("연합인포맥스", "https://news.einfomax.co.kr/rss/allArticle.xml"), # 채권·FX·마켓 전문
("매일경제증권", "https://www.mk.co.kr/rss/50200011/"), # 증권
("한국경제글로벌", "https://www.hankyung.com/feed/international"), # 글로벌마켓
("연합뉴스산업", "https://www.yna.co.kr/rss/industry.xml"), # 산업
("데일리안", "https://www.dailian.co.kr/rss/economy"),
("ZDNet코리아", "https://feeds.feedburner.com/zdkorea"), # IT/테크
("테크M", "https://www.techm.kr/rss/allArticle.xml"), # IT/테크
("전자신문반도체", "https://rss.etnews.com/Section902.xml"), # 반도체 버티컬
("오토헤럴드", "https://www.autoherald.co.kr/rss/allArticle.xml"), # 자동차 버티컬
("철강금속신문", "https://www.snmnews.com/rss/allArticle.xml"), # 철강/소재 버티컬
]
def parse_rss_date(date_str: str) -> str: