Commit 3924e43
feat: Phase 7.4.3 - Semantic classifier with material-aware search
Major improvements to HS code classification accuracy:
Backend - New Services:
- Add semantic-classifier.service.ts for embedding-based classification
- Add query-term-analyzer.service.ts for intelligent query parsing
- Add reranker.service.ts for function-over-material ranking
- Add input-specificity.service.ts for query complexity analysis
- Add attribute-classifier.service.ts for attribute-based classification
Backend - Query Analysis:
- Parse queries into product, variety, processing, material, packaging terms
- Use fullQueryWithoutPackaging to retain material terms (cotton, silicone)
- Exclude only packaging terms (1kg, bags, boxes) from search
- Add LED, LCD, bluetooth, wifi and other electronic variety terms
Backend - Classification Improvements:
- Implement function-over-material reranking (apparel > fabric)
- Add raw material code penalty (3910 silicone oil deprioritized)
- Add dominant chapter detection for direct classification
- Fix coffee classification (0901 not 0902 tea)
- Fix cotton t-shirts classification (6109 direct, not questions)
- Fix LED light bulbs classification (8539 direct, not questions)
Frontend - New Wizard UI:
- Add comprehensive wizard component system
- Add history page with filtering and stats
- Add classification tree visualization
- Add loading states with educational facts
- Add error handling with suggestions
Testing:
- Add comprehensive validation test suite (64 test cases)
- Achieve 67% chapter accuracy, 0% error rate
- Textiles category improved from 33% to 67%
- Metals category improved from 60% to 100%
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent f8d6fbb commit 3924e43
70 files changed
Lines changed: 34971 additions & 695 deletions
File tree
- backend/src
- data
- routes
- services
- tests/comprehensive-validation
- results
- frontend
- src
- app
- classify
- history
- components
- classify
- history
- wizard
- lib
- hooks
- types
- utils
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 | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
665 | 687 | | |
666 | 688 | | |
667 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
228 | 274 | | |
229 | 275 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | | - | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 47 | + | |
55 | 48 | | |
56 | 49 | | |
57 | 50 | | |
| 51 | + | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
62 | 56 | | |
63 | 57 | | |
64 | | - | |
| 58 | + | |
65 | 59 | | |
66 | | - | |
67 | | - | |
| 60 | + | |
| 61 | + | |
68 | 62 | | |
69 | 63 | | |
70 | 64 | | |
| |||
73 | 67 | | |
74 | 68 | | |
75 | 69 | | |
76 | | - | |
| 70 | + | |
77 | 71 | | |
78 | 72 | | |
79 | 73 | | |
| |||
83 | 77 | | |
84 | 78 | | |
85 | 79 | | |
86 | | - | |
| 80 | + | |
87 | 81 | | |
88 | 82 | | |
89 | 83 | | |
| 84 | + | |
90 | 85 | | |
91 | 86 | | |
92 | 87 | | |
93 | 88 | | |
94 | 89 | | |
95 | 90 | | |
96 | | - | |
| 91 | + | |
97 | 92 | | |
98 | | - | |
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 98 | | |
114 | 99 | | |
115 | 100 | | |
| 101 | + | |
116 | 102 | | |
117 | 103 | | |
118 | 104 | | |
119 | 105 | | |
120 | 106 | | |
121 | 107 | | |
122 | | - | |
| 108 | + | |
| 109 | + | |
123 | 110 | | |
124 | 111 | | |
125 | 112 | | |
| |||
141 | 128 | | |
142 | 129 | | |
143 | 130 | | |
| 131 | + | |
144 | 132 | | |
145 | 133 | | |
146 | 134 | | |
| |||
0 commit comments