def compact(self, term_doc_matrix, non_text=False):
		'''
		Parameters
		-------
		term_doc_matrix : TermDocMatrix

		Returns
		-------

		New term doc matrix
		'''
		count_df = self._get_statistics_dataframe(term_doc_matrix, non_text)

		return term_doc_matrix.remove_terms(
			count_df[count_df['pmi'] < self.minimum_pmi].index,
			non_text=non_text
		)

		Parameters
		-------
		term_doc_matrix : TermDocMatrix

		Returns
		-------

		New term doc matrix
		
scattertext/termcompaction/PhraseSelector.py