def get_category_token_counts(self) -> Dict[str, int]:
        '''

        :return: dict, maps category to count of tokens of all documents in that category
        '''

        return dict(
            self.get_df().groupby(self.get_category_column()).apply(
                lambda gdf: gdf[self.get_parsed_column()].apply(
                    lambda doc: sum([t.orth_.strip() != '' for t in doc])
                ).sum()
            )
        )


        :return: dict, maps category to count of tokens of all documents in that category
        
scattertext/ParsedCorpus.py