Phase 5.0: Entity Resolver 테스트 및 datetime 경고 수정
- Entity Resolver (벡터 + Jaro-Winkler 유사도) 테스트 구현 완료 - 24개 유닛 테스트 모두 통과 - TestEntityNormalization: 라벨 정규화 테스트 (4개) - TestJaroWinklerSimilarity: 텍스트 유사도 테스트 (4개) - TestTextSimilarity: 텍스트 유사도 계산 테스트 (4개) - TestEntityResolverInit: 초기화 테스트 (3개) - TestDuplicateDetection: 중복 감지 테스트 (4개, 비동기) - TestClusterResolution: 클러스터 병합 테스트 (2개, 비동기) - TestResolutionReport: 리포트 생성 테스트 (3개) - entity_resolver.py datetime.utcnow() → datetime.now(UTC) 변환 - textdistance>=4.6.0 의존성 추가 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import re
|
||||
import string
|
||||
from typing import Optional, List, Dict, Any
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from datetime import datetime, UTC
|
||||
from difflib import SequenceMatcher
|
||||
|
||||
try:
|
||||
@@ -197,7 +197,7 @@ class EntityResolver:
|
||||
canonical["aliases"] = sorted(list(all_aliases))
|
||||
canonical["evidence"] = evidence_list
|
||||
canonical["merged_from"] = duplicate_ids
|
||||
canonical["merged_at"] = datetime.utcnow().isoformat()
|
||||
canonical["merged_at"] = datetime.now(UTC).isoformat()
|
||||
canonical["merge_confidence"] = cluster.confidence
|
||||
|
||||
return canonical
|
||||
@@ -319,5 +319,5 @@ class EntityResolver:
|
||||
"total_duplicates": total_duplicates,
|
||||
"avg_confidence": float(avg_confidence),
|
||||
"by_reason": reasons,
|
||||
"timestamp": datetime.utcnow().isoformat(),
|
||||
"timestamp": datetime.now(UTC).isoformat(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user