#NEWLINE# def generate_training_corpus( num_sentences , vocabulary_size = 30000 , sentence_min_size = 2 , sentence_max_size = 30 , seed = None ) : #NEWLINE# #INDENT# rs = check_random_state ( seed ) #NEWLINE# for _ in range ( num_sentences ) : #NEWLINE# #INDENT# sentence_size = rs . randint ( sentence_min_size , sentence_max_size ) #NEWLINE# ( yield [ str ( x ) for x in rs . randint ( 0 , vocabulary_size , sentence_size ) ] )