Commit 988391b
feat: 온톨로지 구축 최적화 — HybridClassifier, Batch LLM, EmbeddingRelation, PhraseExtractor
## 1. RuleBasedClassifier confidence score (#1)
- classify_with_confidence() → (NodeKind, float) 반환
- confidence = min(1.0, total_score / 6.0), 6점 이상 확실
- 기존 classify() 하위 호환 유지
## 2. LLMClassifier batch 모드 (#2)
- classify_batch_async(items, content_limit=500)
- 8~16개 문서를 한 번의 LLM 호출로 분류 (비용 3~5x 절감)
- 캐시 히트 제외, JSON 파싱 실패 시 개별 fallback
## 3. HybridClassifier — 2단계 분류 (#1+#2 통합)
- 규칙 confidence >= 0.6 → 확정 (무료, 즉시)
- confidence < 0.6 → LLM 위임 (비용 발생)
- KindClassifier 프로토콜 준수
## 4. EmbeddingRelationDetector (#3)
- cosine similarity 기반 관계 자동 생성 (LLM 불필요)
- similarity_threshold 0.7 이상 → RELATED 엣지
- NodeKind 쌍에 따라 EdgeKind 자동 조정
- fallback으로 RuleBasedRelationDetector 조합 가능
## 5. PhraseExtractor — HippoRAG2 dual-node KG (#4)
- 문서에서 고유명사/키프레이즈 자동 추출 (zero-dep)
- phrase를 ENTITY 노드로 생성, passage→phrase CONTAINS 엣지
- 동일 phrase가 여러 passage에서 bridge 역할
- EdgeKind.CONTAINS 추가
- 1 parent f808f2c commit 988391b
124 files changed
Lines changed: 2004 additions & 4 deletions
File tree
- src/synaptic
- __pycache__
- backends/__pycache__
- extensions
- __pycache__
- tests
- __pycache__
- benchmark
- __pycache__
- data
- qa/__pycache__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments