Recursive approach for finding best matches.
(scores, i)
| 341 | |
| 342 | |
| 343 | def _recursion(scores, i): |
| 344 | """Recursive approach for finding best matches.""" |
| 345 | if scores.shape[0] == 0 or scores.shape[1] == 0: |
| 346 | return [], 0.0 |
| 347 | index = np.argmax(scores[0, :]) |
| 348 | score = scores[0, index] |
| 349 | if score > IOU_THRESHOLD: |
| 350 | seq_, score_ = _recursion(scores[1:, 1:], i + 1) |
| 351 | return [index + i, *seq_], score_ + score |
| 352 | else: |
| 353 | seq_, score_ = _recursion(scores[1:, :], i) |
| 354 | return [None, *seq_], score_ |
| 355 | |
| 356 | |
| 357 | def match_sents(sents_a, sents_b): |
no outgoing calls
no test coverage detected
searching dependent graphs…