#NEWLINE# def compute_perplexities( vals , test_data , smoothing ) : #NEWLINE# #INDENT# return [ np . exp ( ( ( - log_likelihood ( test_data , wordprobs ( test_data , val ) ) ) / test_data . sum ( ) ) ) for val in val ]