From 4ce5f9014c7e7dae3abfab2b94ff2a02faaa0779 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sat, 13 Sep 2025 11:20:03 +0800 Subject: [PATCH] Improve error messages in entity and relationship extraction --- lightrag/operate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index bdc5bbd2..42093a3d 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -323,7 +323,7 @@ async def _handle_single_entity_extraction( if len(record_attributes) != 4 or "entity" not in record_attributes[0]: if len(record_attributes) > 1 and "entity" in record_attributes[0]: logger.warning( - f"{chunk_key}: extraction failed! only got {len(record_attributes)} feilds on entity `{record_attributes[1]}`" + f"{chunk_key}: extraction failed! Found {len(record_attributes)}/4 feilds on ENTITY `{record_attributes[1]}`" ) return None @@ -394,7 +394,7 @@ async def _handle_single_relationship_extraction( if len(record_attributes) != 5 or "relationship" not in record_attributes[0]: if len(record_attributes) > 1 and "relationship" in record_attributes[0]: logger.warning( - f"{chunk_key}: extraction failed! only got {len(record_attributes)} fields on realtion `{record_attributes[1]}`" + f"{chunk_key}: extraction failed! Found {len(record_attributes)}/5 fields on REALTION `{record_attributes[1]}`" ) return None