Add support for handling non-identity entity types in detection logic
Deploy Development / deploy (push) Successful in 54s
Test Suite / pytest-backend (push) Successful in 2m37s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 15s
Deploy Production / deploy (push) Successful in 43s

- Introduced a new set of non-identity entity types (FOOD, DISH, MEAL, CUISINE, FOODSTUFF, INGREDIENT) that are omitted from detection results without causing contract violations.
- Updated the `DetectionStats` class to track omitted non-identity types.
- Modified validation logic to ensure that food-related mentions are not treated as identity types, preserving the context of mentions as either PERSON or omitted.
- Enhanced tests to verify the correct handling of food homonyms and ensure that invalid entity types are recorded appropriately without causing errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-09-08 07:35:44 +02:00
1 parent 79e4fd0d4b
commit dd7858347c
7 files changed
+170 -22

No files matched your search

+1
View File
@@ -289,6 +289,7 @@ def persist_engine_error(
"detect_partial_discarded",
"contract_violation",
"invalid_entity_type",
"omitted_non_identity_types",
"generate_called",
):
if merged.get(key) is None: