Worker function to process a single paragraph for entity matching. Unpacks arguments, creates a Corpus object, and performs matching.
(args_tuple)
| 331 | |
| 332 | # Helper function for multiprocessing Aho-Corasick matching |
| 333 | def _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 | |
| 348 | def main(): |
nothing calls this directly
no test coverage detected