# 2025-10-22 Coldmail Naive Bayes 피처 확장 적용 ## 개요 - 목적: 콜드메일 분류의 학습 신호를 제목 중심에서 본문/첨부/도메인까지 확대. - 변경 범위: Naive Bayes 특징추출, 하이브리드 필터 연동. ## 코드 변경 - rb8001/app/services/coldmail_filter.py - `extract_features(subject, sender_email, body, attachments)`로 확장 - 토큰화 대상: 제목 + 본문 + 첨부파일명 (+ 도메인 특수 토큰 `__DOMAIN_VC__`) - `is_coldmail(...)`와 `update_classifier(...)`가 확장 피처 사용 - rb8001/app/services/coldmail_hybrid_filter.py - Stage 3(NB) 호출에 `body`/`attachments` 전달 ## 동작 - 판정: 라플라스 스무딩을 적용한 다항 나이브 베이즈로 P(coldmail|features) 산출 - 학습: Slack “맞음/아님” 피드백 시 `coldmail_classifier(word, coldmail_count, normal_count)`를 단어별 upsert - 영향: 본문 키워드, 첨부파일명 시그널이 누적되어 향후 분류 정확도 개선 ## 확인 방법 ```bash # 실DB 읽기 전용 쿼리 예시 (23 서버 main_db) PGPASSWORD=robeings psql -h 192.168.219.45 -U robeings -d main_db -c \ "SELECT word, coldmail_count, normal_count FROM coldmail_classifier WHERE word IN ('투자','ir','deck');" ``` ## 릴리스 노트 - feat(coldmail): expand Naive Bayes features to include body and attachment tokens; wire through hybrid filter - 관련 티켓: 하이브리드 필터 개선안(Explainability, Signal 확장)