mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Let a deterministic guard override the fallback classifier per description 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4396e5fb22
commit
0a9d835e66
1 changed files with 12 additions and 1 deletions
|
|
@ -28,4 +28,15 @@ class GuardedColumnClassifier(ColumnClassifier[E]):
|
|||
self._fallback = fallback
|
||||
|
||||
def classify(self, descriptions: set[str]) -> dict[str, E]:
|
||||
raise NotImplementedError
|
||||
guarded: dict[str, E] = {}
|
||||
misses: set[str] = set()
|
||||
for description in descriptions:
|
||||
member = self._guard(description)
|
||||
if member is not None:
|
||||
guarded[description] = member
|
||||
else:
|
||||
misses.add(description)
|
||||
# Only the misses reach the fallback — a fully-guarded batch never calls it.
|
||||
if misses:
|
||||
guarded.update(self._fallback.classify(misses))
|
||||
return guarded
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue