def make_sampling_table(size, sampling_factor=1e-05):
 gamma = 0.577
 rank = np.array(list(range(size)))
 rank[0] = 1
 inv_fq = (((rank * (np.log(rank) + gamma)) + 0.5) - (1.0 / (12.0 * rank)))
 f = (sampling_factor * inv_fq)
 return np.minimum(1.0, (f / np.sqrt(f)))

def make_sampling_table ( size , sampling_factor = 1e-05 ) : gamma = 0.577 rank = np . array ( list ( range ( size ) ) ) rank [ 0 ] = 1 inv_fq = ( ( ( rank * ( np . log ( rank ) + gamma ) ) + 0.5 ) - ( 1.0 / ( 12.0 * rank ) ) ) f = ( sampling_factor * inv_fq ) return np . minimum ( 1.0 , ( f / np . sqrt ( f ) ) )
generates a word rank-based probabilistic sampling table .