def get_selected_terms(term_doc_matrix, scores, num_term_to_keep=None):
		'''
		Parameters
		----------
		term_doc_matrix: TermDocMatrix or descendant
		scores: array-like
			Same length as number of terms in TermDocMatrix.
		num_term_to_keep: int, default=4000.
			Should be> 0. Number of terms to keep. Will keep between num_terms_to_keep/2 and num_terms_to_keep.

		Returns
		-------
		set, terms that should be shown
		'''
		num_term_to_keep = AutoTermSelector._add_default_num_terms_to_keep(num_term_to_keep)
		term_doc_freq = term_doc_matrix.get_term_freq_df()
		term_doc_freq['count'] = term_doc_freq.sum(axis=1)
		term_doc_freq['score'] = scores
		score_terms = AutoTermSelector._get_score_terms(num_term_to_keep, term_doc_freq)
		background_terms = AutoTermSelector._get_background_terms(num_term_to_keep, term_doc_matrix)
		frequent_terms = AutoTermSelector._get_frequent_terms(num_term_to_keep, term_doc_freq)
		terms_to_show = score_terms | background_terms | frequent_terms
		return terms_to_show
def get_selected_terms ( term_doc_matrix , scores , num_term_to_keep = None ) : num_term_to_keep = AutoTermSelector . _add_default_num_terms_to_keep ( num_term_to_keep ) term_doc_freq = term_doc_matrix . get_term_freq_df ( ) term_doc_freq [ 'count' ] = term_doc_freq . sum ( axis = 1 ) term_doc_freq [ 'score' ] = scores score_terms = AutoTermSelector . _get_score_terms ( num_term_to_keep , term_doc_freq ) background_terms = AutoTermSelector . _get_background_terms ( num_term_to_keep , term_doc_matrix ) frequent_terms = AutoTermSelector . _get_frequent_terms ( num_term_to_keep , term_doc_freq ) terms_to_show = score_terms | background_terms | frequent_terms return terms_to_show
Parameters
		----------
		term_doc_matrix: TermDocMatrix or descendant
		scores: array-like
			Same length as number of terms in TermDocMatrix.
		num_term_to_keep: int, default=4000.
			Should be> 0. Number of terms to keep. Will keep between num_terms_to_keep/2 and num_terms_to_keep.

		Returns
		-------
		set, terms that should be shown