Update operate.py
Browse files- lightrag/operate.py +2 -2
lightrag/operate.py
CHANGED
@@ -76,7 +76,7 @@ async def _handle_single_entity_extraction(
|
|
76 |
record_attributes: list[str],
|
77 |
chunk_key: str,
|
78 |
):
|
79 |
-
if record_attributes[0] != '"entity"'
|
80 |
return None
|
81 |
# add this record as a node in the G
|
82 |
entity_name = clean_str(record_attributes[1].upper())
|
@@ -97,7 +97,7 @@ async def _handle_single_relationship_extraction(
|
|
97 |
record_attributes: list[str],
|
98 |
chunk_key: str,
|
99 |
):
|
100 |
-
if record_attributes[0] != '"relationship"'
|
101 |
return None
|
102 |
# add this record as edge
|
103 |
source = clean_str(record_attributes[1].upper())
|
|
|
76 |
record_attributes: list[str],
|
77 |
chunk_key: str,
|
78 |
):
|
79 |
+
if len(record_attributes) < 4 or record_attributes[0] != '"entity"':
|
80 |
return None
|
81 |
# add this record as a node in the G
|
82 |
entity_name = clean_str(record_attributes[1].upper())
|
|
|
97 |
record_attributes: list[str],
|
98 |
chunk_key: str,
|
99 |
):
|
100 |
+
if len(record_attributes) < 5 or record_attributes[0] != '"relationship"':
|
101 |
return None
|
102 |
# add this record as edge
|
103 |
source = clean_str(record_attributes[1].upper())
|