MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / _process_paragraph_for_matching

Function _process_paragraph_for_matching

CommonKG/create_kg.py:333–345  ·  view source on GitHub ↗

Worker function to process a single paragraph for entity matching. Unpacks arguments, creates a Corpus object, and performs matching.

(args_tuple)

Source from the content-addressed store, hash-verified

331
332# Helper function for multiprocessing Aho-Corasick matching
333def _process_paragraph_for_matching(args_tuple):
334 """
335 Worker function to process a single paragraph for entity matching.
336 Unpacks arguments, creates a Corpus object, and performs matching.
337 """
338 item, file_name, local_next_layer_entities, source_id, text_key = args_tuple
339 corpus = Corpus(
340 doc_name=file_name,
341 source_id=item[source_id],
342 corpus=item[text_key]
343 )
344 match_words = corpus.get_match_words(local_next_layer_entities)
345 return match_words
346
347
348def main():

Callers

nothing calls this directly

Calls 2

get_match_wordsMethod · 0.95
CorpusClass · 0.90

Tested by

no test coverage detected