nimare.annotate.text.generate_counts¶
-
generate_counts(text_df, text_column='abstract', tfidf=True)[source]¶ Generate tf-idf weights for unigrams/bigrams derived from textual data.
Parameters: text_df ((D x 2) pandas.DataFrame) – A DataFrame with two columns (‘id’ and ‘text’). D = document.Returns: weights_df – A DataFrame where the index is ‘id’ and the columns are the unigrams/bigrams derived from the data. D = document. T = term. Return type: (D x T) pandas.DataFrame