def sentence_ribes(references, hypothesis, alpha=0.25, beta=0.1):
 best_ribes = (-1.0)
 for reference in references:
  worder = word_rank_alignment(reference, hypothesis)
  nkt = kendall_tau(worder)
  bp = min(1.0, math.exp((1.0 - (len(reference) / len(hypothesis)))))
  p1 = (len(worder) / len(hypothesis))
  _ribes = ((nkt * (p1 ** alpha)) * (bp ** beta))
  if (_ribes > best_ribes):
   best_ribes = _ribes
 return best_ribes

def sentence_ribes ( references , hypothesis , alpha = 0.25 , beta = 0.1 ) : best_ribes = ( - 1.0 ) for reference in references : worder = word_rank_alignment ( reference , hypothesis ) nkt = kendall_tau ( worder ) bp = min ( 1.0 , math . exp ( ( 1.0 - ( len ( reference ) / len ( hypothesis ) ) ) ) ) p1 = ( len ( worder ) / len ( hypothesis ) ) _ribes = ( ( nkt * ( p1 ** alpha ) ) * ( bp ** beta ) ) if ( _ribes > best_ribes ) : best_ribes = _ribes return best_ribes
the ribes from hideki isozaki .