From 2fefb57356e6aee653aaffba4c49f59944f76f69 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 8 May 2025 16:05:08 +0800 Subject: [PATCH] Normalize keyword extration result --- lightrag/operate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index 086de3d5..b110048f 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -218,7 +218,9 @@ async def _handle_single_relationship_extraction( edge_description = clean_str(record_attributes[3]) edge_description = normalize_extracted_info(edge_description) - edge_keywords = clean_str(record_attributes[4]).strip('"').strip("'") + edge_keywords = normalize_extracted_info(clean_str(record_attributes[4]), is_entity=True) + edge_keywords = edge_keywords.replace(",", ",") + edge_source_id = chunk_key weight = ( float(record_attributes[-1].strip('"').strip("'"))