Module Expr Str ImportFrom alias alias alias alias Import alias Import alias Import alias identifier Import alias identifier ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad NameLoad Num Num Num NameLoad body Expr Str Assign NameStore Call NameLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad GeneratorExp TupleLoad BinOpSub SubscriptLoad NameLoad Index NameLoad Num NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr GeneratorExp NameLoad comprehension TupleStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr GeneratorExp NameLoad comprehension TupleStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad TupleLoad NameLoad NameLoad keyword NameLoad attr Assign NameStore DictComp BinOpSub NameLoad Num NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad CompareNotEq NameLoad Num If BoolOpOr CompareNotEq NameLoad Num CompareNotEq NameLoad Num CompareIsNot NameLoad NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If CompareNotEq NameLoad Num body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad keyword Num keyword NameLoad orelse If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad keyword NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad keyword Str keyword Num keyword NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareIs NameLoad NameLoad body AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr BinOpDiv NameLoad NameLoad Num Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Num attr If CompareIs NameLoad NameLoad body Return BinOpDiv NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad If CompareIs NameLoad NameLoad body Return BinOpDiv NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore BinOpSub BinOpMult UnaryOpUSub NameLoad Call AttributeLoad NameLoad attr NameLoad BinOpMult BinOpSub Num NameLoad Call AttributeLoad NameLoad attr BinOpSub Num NameLoad Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num Num NameLoad body Expr Str If BoolOpAnd CompareEq NameLoad Num CompareEq NameLoad Num CompareIs NameLoad NameLoad body Return TupleLoad NameLoad NameLoad If BoolOpOr CompareLt NameLoad Num CompareLt NameLoad Num BoolOpAnd CompareIsNot NameLoad NameLoad CompareLt NameLoad Num body Raise Call NameLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore IfExp Call NameLoad NameLoad NameLoad NameLoad Call NameLoad BinOpMult NameLoad NameLoad Assign NameStore IfExp Call NameLoad NameLoad NameLoad NameLoad Call NameLoad BinOpMult NameLoad NameLoad If CompareLt NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If CompareLt NameLoad NameLoad body AugAssignBitAnd NameStore CompareLtE NameLoad NameLoad If CompareGt NameLoad Num body AugAssignBitAnd NameStore CompareGtE NameLoad NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad CompareGt Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore SubscriptLoad SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Slice Num Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign SubscriptStore NameLoad Index SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Index NameLoad NameLoad Assign NameStore NameLoad Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore DictComp SubscriptLoad NameLoad Index NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num If CompareEq Call NameLoad NameLoad Num body Assign NameStore Str Raise Call NameLoad NameLoad Return TupleLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Expr Str If BoolOpAnd CompareEq NameLoad Num CompareIs NameLoad NameLoad body Return TupleLoad NameLoad NameLoad If BoolOpOr CompareLt NameLoad Num CompareGt NameLoad Num body Raise Call NameLoad Str If BoolOpAnd CompareIsNot NameLoad NameLoad CompareLt NameLoad Num body Raise Call NameLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If CompareGt NameLoad Num body AugAssignBitAnd NameStore CompareGtE NameLoad NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad CompareGt Call AttributeLoad NameLoad attr NameLoad body Assign NameStore SubscriptLoad SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Slice Num Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign SubscriptStore NameLoad Index SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Index NameLoad NameLoad Assign NameStore NameLoad Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore DictComp SubscriptLoad NameLoad Index NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num If CompareEq Call NameLoad NameLoad Num body Raise Call NameLoad Str Return TupleLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad decorator_list
N/A N/A 
Represent a collection of spacy-processed texts as a document-term matrix of shape
(# docs, # unique terms), with a variety of filtering, normalization, and term
weighting schemes for the values.
 __future__ absolute_import division print_function unicode_literals N/A collections N/A itertools N/A numpy np N/A scipy.sparse sp sklearn.preprocessing binarize binarize_mat sklearn.preprocessing normalize normalize_mat spacy.strings StringStore build_doc_term_matrix N/A N/A terms_lists weighting normalize sublinear_tf smooth_idf min_df max_df min_ic max_n_terms N/A tf False False True 1 1.0 0.0 None N/A N/A 
    Build a document-term matrix of shape (# docs, # unique terms) from a sequence
    of documents, each represented as a sequence of (str) terms, with a variety of
    weighting and normalization schemes for the matrix values.

    Args:
        terms_lists (iterable(iterable(str))): a sequence of documents, each as a
            sequence of (str) terms; note that the terms in each doc are to be
            counted, so these probably shouldn't be sets containing *unique* terms;
            example inputs::

                >>> ([tok.lemma_ for tok in spacy_doc]
                ...  for spacy_doc in spacy_docs)
                >>> ((ne.text for ne in doc.named_entities())
                ...  for doc in textcorpus)
                >>> (tuple(ng.text for ng in itertools.chain.from_iterable(doc.ngrams(i) for i in range(1, 3)))
                ...  for doc in docs)

        weighting (str {'tf', 'tfidf', 'binary'}, optional): if 'tf', matrix values
            (i, j) correspond to the number of occurrences of term j in doc i; if
            'tfidf', term frequencies (tf) are multiplied by their corresponding
            inverse document frequencies (idf); if 'binary', all non-zero values
            are set equal to 1
        normalize (bool, optional): if True, normalize term frequencies by the
            L2 norms of the vectors
        binarize (bool, optional): if True, set all term frequencies greater than
            0 equal to 1
        sublinear_tf (bool, optional): if True, apply sub-linear term-frequency
            scaling, i.e. tf => 1 + log(tf)
        smooth_idf (bool, optional): if True, add 1 to all document frequencies,
            equivalent to adding a single document to the corpus containing every
            unique term
        min_df (float or int, optional): if float, value is the fractional proportion
            of the total number of documents, which must be in [0.0, 1.0]; if int,
            value is the absolute number; filter terms whose document frequency
            is less than ``min_df``
        max_df (float or int, optional): if float, value is the fractional proportion
            of the total number of documents, which must be in [0.0, 1.0]; if int,
            value is the absolute number; filter terms whose document frequency
            is greater than ``max_df``
        min_ic (float, optional): filter terms whose information content is less
            than `min_ic`; value must be in [0.0, 1.0]
        max_n_terms (int, optional): only include terms whose document frequency
            is within the top ``max_n_terms``

    Returns:
        :class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix>`: sparse matrix
            of shape (# docs, # unique terms), where value (i, j) is the weight
            of term j in doc i
        dict: id to term mapping, where keys are unique integers as term ids and
            values are corresponding strings
     N/A stringstore N/A StringStore N/A data N/A N/A rows N/A N/A cols N/A N/A N/A row_idx terms_list N/A enumerate terms_lists N/A N/A bow N/A tuple N/A N/A N/A N/A stringstore N/A term 1 count N/A N/A term count N/A N/A N/A N/A collections Counter terms_list items term N/A N/A N/A data extend N/A count N/A N/A _ count bow N/A N/A N/A cols extend N/A term_id N/A N/A term_id _ bow N/A N/A N/A rows extend N/A N/A itertools repeat row_idx times N/A len bow N/A doc_term_matrix N/A N/A N/A N/A sp coo_matrix N/A data N/A rows cols dtype int tocsr N/A id_to_term N/A N/A term_id 1 term N/A N/A term_id term N/A enumerate stringstore N/A term_id 0 N/A N/A N/A max_df 1.0 N/A min_df 1 N/A max_n_terms None N/A N/A N/A doc_term_matrix id_to_term N/A filter_terms_by_df doc_term_matrix id_to_term max_df max_df min_df min_df max_n_terms max_n_terms N/A N/A min_ic 0.0 N/A N/A N/A doc_term_matrix id_to_term N/A filter_terms_by_ic doc_term_matrix id_to_term min_ic min_ic max_n_terms max_n_terms N/A N/A weighting binary N/A N/A doc_term_matrix N/A binarize_mat doc_term_matrix threshold 0.0 copy False N/A N/A N/A sublinear_tf True N/A N/A doc_term_matrix N/A N/A doc_term_matrix astype N/A np float64 N/A N/A N/A np log N/A doc_term_matrix data N/A doc_term_matrix data N/A N/A doc_term_matrix data 1 N/A N/A weighting tfidf N/A N/A doc_term_matrix N/A apply_idf_weighting doc_term_matrix smooth_idf smooth_idf N/A N/A normalize True N/A N/A doc_term_matrix N/A normalize_mat doc_term_matrix norm l2 axis 1 copy False N/A N/A doc_term_matrix id_to_term N/A apply_idf_weighting N/A N/A doc_term_matrix smooth_idf N/A True N/A N/A 
    Apply inverse document frequency (idf) weighting to a term-frequency (tf)
    weighted document-term matrix, optionally smoothing idf values.

    Args:
        doc_term_matrix (:class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix`):
            M X N matrix, where M is the # of docs and N is the # of unique terms
        smooth_idf (bool, optional): if True, add 1 to all document frequencies,
            equivalent to adding a single document to the corpus containing every
            unique term

    Returns:
        :class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix>`: sparse matrix
            of shape (# docs, # unique terms), where value (i, j) is the tfidf
            weight of term j in doc i
     N/A dfs N/A get_doc_freqs doc_term_matrix normalized False N/A n_docs N/A N/A doc_term_matrix shape N/A 0 N/A N/A smooth_idf True N/A N/A n_docs 1 N/A dfs 1 N/A idfs N/A N/A N/A np log N/A n_docs dfs 1.0 N/A N/A N/A doc_term_matrix dot N/A N/A sp diags idfs 0 N/A get_term_freqs N/A N/A doc_term_matrix normalized N/A True N/A N/A 
    Compute absolute or relative term frequencies for all terms in a
    document-term matrix.

    Args:
        doc_term_matrix (:class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix`):
            M X N matrix, where M is the # of docs and N is the # of unique terms

            Note: Weighting on the terms DOES matter! Only absolute term counts
            (rather than normalized term frequencies) should be used here
        normalized (bool, optional): if True, return normalized term frequencies,
            i.e. term counts divided by the total number of terms; if False,
            return absolute term counts

    Returns:
        :class:`numpy.ndarray <numpy.ndarray>`: array of absolute or relative term
            frequencies, with length equal to the # of unique terms, i.e. # of
            columns in ``doc_term_matrix``

    Raises:
        ValueError: if ``doc_term_matrix`` doesn't have any non-zero entries
     N/A N/A N/A doc_term_matrix nnz 0 N/A N/A N/A ValueError term-document matrix must have at least 1 non-zero entry N/A N/A _ n_terms N/A doc_term_matrix shape N/A tfs N/A N/A N/A N/A np asarray N/A N/A doc_term_matrix sum axis 0 ravel N/A N/A normalized True N/A N/A N/A tfs n_terms N/A N/A tfs N/A get_doc_freqs N/A N/A doc_term_matrix normalized N/A True N/A N/A 
    Compute absolute or relative document frequencies for all terms in a
    term-document matrix.

    Args:
        doc_term_matrix (:class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix`):
            M X N matrix, where M is the # of docs and N is the # of unique terms

            Note: Weighting on the terms doesn't matter! Could be 'tf' or 'tfidf'
            or 'binary' weighting, a term's doc freq will be the same
        normalized (bool, optional): if True, return normalized doc frequencies,
            i.e. doc counts divided by the total number of docs; if False,
            return absolute doc counts

    Returns:
        :class:`numpy.ndarray`: array of absolute or relative document
            frequencies, with length equal to the # of unique terms, i.e. # of
            columns in ``doc_term_matrix``

    Raises:
        ValueError: if ``doc_term_matrix`` doesn't have any non-zero entries
     N/A N/A N/A doc_term_matrix nnz 0 N/A N/A N/A ValueError term-document matrix must have at least 1 non-zero entry N/A N/A n_docs n_terms N/A doc_term_matrix shape N/A dfs N/A N/A np bincount N/A doc_term_matrix indices minlength n_terms N/A N/A normalized True N/A N/A N/A dfs n_docs N/A N/A dfs N/A get_information_content N/A N/A doc_term_matrix N/A N/A N/A 
    Compute information content for all terms in a term-document matrix. IC is a
    float in [0.0, 1.0], defined as ``-df * log2(df) - (1 - df) * log2(1 - df)``,
    where df is a term's normalized document frequency.

    Args:
        doc_term_matrix (:class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix`):
            M X N matrix, where M is the # of docs and N is the # of unique terms

            Note: Weighting on the terms doesn't matter! Could be 'tf' or 'tfidf'
            or 'binary' weighting, a term's information content will be the same

    Returns:
        :class:`numpy.ndarray`: array of term information content values,
            with length equal to the # of unique terms, i.e. # of
            columns in ``doc_term_matrix``

    Raises:
        ValueError: if ``doc_term_matrix`` doesn't have any non-zero entries
     N/A dfs N/A get_doc_freqs doc_term_matrix normalized True N/A ics N/A N/A N/A dfs N/A N/A np log2 dfs N/A N/A 1 dfs N/A N/A np log2 N/A 1 dfs N/A N/A ics N/A N/A N/A np isnan ics 0.0 N/A ics N/A filter_terms_by_df N/A N/A doc_term_matrix id_to_term max_df min_df max_n_terms N/A 1.0 1 None N/A N/A 
    Filter out terms that are too common and/or too rare (by document frequency),
    and compactify the top ``max_n_terms`` in the ``id_to_term`` mapping accordingly.
    Borrows heavily from the ``sklearn.feature_extraction.text`` module.

    Args:
        doc_term_matrix (:class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix`):
            M X N matrix, where M is the # of docs and N is the # of unique terms
        id_to_term (dict): mapping of unique integer term identifiers to
            their corresponding normalized strings
        min_df (float in [0.0, 1.0] or int, optional): if float, value is the
            fractional proportion of the total number of documents and must be
            in [0.0, 1.0]; if int, value is the absolute number; filter terms
            whose document frequency is less than ``min_df``
        max_df (float in [0.0, 1.0] or int, optional): if float, value is the
            fractional proportion of the total number of documents and must be
            in [0.0, 1.0]; if int, value is the absolute number; filter terms
            whose document frequency is greater than ``max_df``
        max_n_terms (int, optional): only include terms whose *term* frequency
            is within the top `max_n_terms`

    Returns:
        :class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix>`: sparse matrix
            of shape (# docs, # unique *filtered* terms), where value (i, j) is the
            weight of term j in doc i
        dict: id to term mapping, where keys are unique *filtered* integers as
            term ids and values are corresponding strings

    Raises:
        ValueError: if ``max_df`` or ``min_df`` or ``max_n_terms`` < 0
     N/A N/A N/A max_df 1.0 N/A min_df 1 N/A max_n_terms None N/A N/A N/A doc_term_matrix id_to_term N/A N/A N/A max_df 0 N/A min_df 0 N/A N/A max_n_terms None N/A max_n_terms 0 N/A N/A N/A ValueError max_df, min_df, and max_n_terms may not be negative N/A N/A n_docs n_terms N/A doc_term_matrix shape N/A max_doc_count N/A N/A isinstance max_df int max_df N/A int N/A max_df n_docs N/A min_doc_count N/A N/A isinstance min_df int min_df N/A int N/A min_df n_docs N/A N/A max_doc_count min_doc_count N/A N/A N/A ValueError max_df corresponds to fewer documents than min_df N/A dfs N/A get_doc_freqs doc_term_matrix normalized False N/A mask N/A N/A np ones n_terms dtype bool N/A N/A max_doc_count n_docs N/A N/A mask N/A dfs max_doc_count N/A N/A min_doc_count 1 N/A N/A mask N/A dfs min_doc_count N/A N/A N/A max_n_terms None N/A N/A N/A mask sum max_n_terms N/A N/A tfs N/A get_term_freqs doc_term_matrix normalized False N/A top_mask_inds N/A N/A N/A N/A N/A tfs N/A mask argsort N/A -1 N/A max_n_terms N/A new_mask N/A N/A np zeros n_terms dtype bool N/A N/A new_mask N/A N/A N/A N/A N/A np where mask N/A 0 N/A top_mask_inds True N/A mask new_mask N/A new_indices N/A N/A N/A np cumsum mask 1 N/A id_to_term N/A N/A new_indices N/A old_index term N/A N/A old_index term N/A N/A id_to_term items N/A mask N/A old_index N/A kept_indices N/A N/A N/A np where mask N/A 0 N/A N/A N/A len kept_indices 0 N/A N/A msg After filtering, no terms remain; try a lower `min_df` or higher `max_df` N/A N/A ValueError msg N/A N/A N/A doc_term_matrix N/A N/A N/A kept_indices id_to_term N/A filter_terms_by_ic N/A N/A doc_term_matrix id_to_term min_ic max_n_terms N/A 0.0 None N/A N/A 
    Filter out terms that are too common and/or too rare (by information content),
    and compactify the top ``max_n_terms`` in the ``id_to_term`` mapping accordingly.
    Borrows heavily from the ``sklearn.feature_extraction.text`` module.

    Args:
        doc_term_matrix (:class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix`):
            M X N matrix, where M is the # of docs and N is the # of unique terms
        id_to_term (dict): mapping of unique integer term identifiers to
            corresponding normalized strings as values
        min_ic (float, optional): filter terms whose information content is less
            than this value; must be in [0.0, 1.0]
        max_n_terms (int, optional): only include terms whose information content
            is within the top ``max_n_terms``

    Returns:
        :class:`scipy.sparse.csr_matrix <scipy.sparse.csr_matrix>`: sparse matrix
            of shape (# docs, # unique *filtered* terms), where value (i, j) is the
            weight of term j in doc i
        dict: id to term mapping, where keys are unique *filtered* integers as
            term ids and values are corresponding strings

    Raises:
        ValueError: if ``min_ic`` not in [0.0, 1.0] or ``max_n_terms`` < 0
     N/A N/A N/A min_ic 0.0 N/A max_n_terms None N/A N/A N/A doc_term_matrix id_to_term N/A N/A N/A min_ic 0.0 N/A min_ic 1.0 N/A N/A N/A ValueError min_ic must be a float in [0.0, 1.0] N/A N/A N/A max_n_terms None N/A max_n_terms 0 N/A N/A N/A ValueError max_n_terms may not be negative N/A N/A _ n_terms N/A doc_term_matrix shape N/A ics N/A get_information_content doc_term_matrix N/A mask N/A N/A np ones n_terms dtype bool N/A N/A min_ic 0.0 N/A N/A mask N/A ics min_ic N/A N/A N/A max_n_terms None N/A N/A N/A mask sum max_n_terms N/A N/A top_mask_inds N/A N/A N/A N/A N/A ics N/A mask argsort N/A -1 N/A max_n_terms N/A new_mask N/A N/A np zeros n_terms dtype bool N/A N/A new_mask N/A N/A N/A N/A N/A np where mask N/A 0 N/A top_mask_inds True N/A mask new_mask N/A new_indices N/A N/A N/A np cumsum mask 1 N/A id_to_term N/A N/A new_indices N/A old_index term N/A N/A old_index term N/A N/A id_to_term items N/A mask N/A old_index N/A kept_indices N/A N/A N/A np where mask N/A 0 N/A N/A N/A len kept_indices 0 N/A N/A N/A ValueError After filtering, no terms remain; try a lower `min_ic` N/A N/A N/A doc_term_matrix N/A N/A N/A kept_indices id_to_term N/A