MCPcopy Create free account
hub / github.com/google-research/language / _recursion

Function _recursion

language/fruit/rendering_utils.py:343–354  ·  view source on GitHub ↗

Recursive approach for finding best matches.

(scores, i)

Source from the content-addressed store, hash-verified

341
342
343def _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
357def match_sents(sents_a, sents_b):

Callers 1

match_sentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…