in src/biencoder_predict_qa.py [0:0]
def find_span(start_probs, end_probs, max_ans_len=MAX_ANS_LEN):
best_score = 0.0
best_start = None
best_end = None
for i in range(len(start_probs)):
start_score = start_probs[i]
for j in range(i, min(i + max_ans_len, len(end_probs))):
end_score = end_probs[j]
cur_score = start_score * end_score
if cur_score > best_score:
best_score = cur_score
best_start = i
best_end = j
return best_start, best_end