From d2d755db7be46d510002ee113d2420d29a79be0b Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 8 May 2025 16:05:52 +0800 Subject: [PATCH] Normalize keyword extration result --- lightrag/operate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index 086de3d5..0d5c7866 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -218,7 +218,11 @@ 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("'"))