MCPcopy Index your code
hub / github.com/KnowledgeXLab/LeanRAG / _handle_single_entity_extraction

Function _handle_single_entity_extraction

_cluster_utils.py:303–321  ·  view source on GitHub ↗
(
    record_attributes: list[str],
    chunk_key: str,
)

Source from the content-addressed store, hash-verified

301 return results
302
303async def _handle_single_entity_extraction(
304 record_attributes: list[str],
305 chunk_key: str,
306):
307 if len(record_attributes) < 4 or record_attributes[0] != '"entity"':
308 return None
309 # add this record as a node in the G
310 entity_name = clean_str(record_attributes[1].upper())
311 if not entity_name.strip():
312 return None
313 entity_type = clean_str(record_attributes[2].upper())
314 entity_description = clean_str(record_attributes[3])
315 entity_source_id = chunk_key
316 return dict(
317 entity_name=entity_name,
318 entity_type=entity_type,
319 description=entity_description,
320 source_id=entity_source_id,
321 )
322
323
324async def _handle_single_relationship_extraction(

Callers

nothing calls this directly

Calls 1

clean_strFunction · 0.90

Tested by

no test coverage detected